Sep 7, 2018 · 1 min read
In my testing, this is faster:
say "^yl: " ~ @array.hyper.grep(*.starts-with("yl")).elems;And this is even faster:
say "^yl: " ~ +race grep *.starts-with("yl"), @array;One of the first things to think about in Perl 6 is: would my algorithm benefit from parallelization? And then to add it with one of the simple keywords or operators like race, hyper, or ». It’s not just a habit from Perl 5 we need to change, but a habit from all serial languages. Thinking about the programs of the future should be thinking in parallel.