Timo Paulssen
Sep 7, 2018 · 1 min read

Here’s another tiny optimization: Going from

my @e = (@a.roll(8).join for ^1_000_000);

to

my @e = @a.roll(8).join xx 1_000_000;

not only takes the run time from 4.2s to 3.95s. Probably because there’s no need for $_ to have the numbers from 0 through 999_999 in it to be passed to the code. Also, you can drop one level of either parenthesis around it (or alternatively having a “do” prefix after the assignment).

    Timo Paulssen

    Written by