Brent Laabs
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.

    Brent Laabs

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade