Skip to content

Instantly share code, notes, and snippets.

@skids
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skids/255ade0fc1b2709e22b3 to your computer and use it in GitHub Desktop.
Save skids/255ade0fc1b2709e22b3 to your computer and use it in GitHub Desktop.
performance of a zip in for's list.
$ time perl6 -e 'my @a = (^64); my @b = (^64); my $i = 0; while ($i++ < 1000) { for @a Z @b -> $a, $b { } }'
real 0m11.031s
user 0m10.992s
sys 0m0.032s
$ time perl6 -e 'my @a = (^64); my @b = (^64); my @c = @a Z @b; my $i = 0; while ($i++ < 1000) { for @c -> $a, $b { } }'
real 0m0.900s
user 0m0.876s
sys 0m0.020s
$ time perl6 -e 'constant @a = (^64); constant @b = (^64); my $i = 0; while ($i++ < 1000) { for @a Z @b -> $a, $b { } }'
real 0m10.813s
user 0m10.788s
sys 0m0.020s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment