Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created August 16, 2019 16:21
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 Whateverable/10b2bab00c6eeb58f34555ef43f91e49 to your computer and use it in GitHub Desktop.
Save Whateverable/10b2bab00c6eeb58f34555ef43f91e49 to your computer and use it in GitHub Desktop.
benchable6
compare HEAD sub foo($a, $b, $c, $d) { my $e = $a; my $f = $b; my $g = $c; my $h = $d; $e++; $f++; $g++; $h++; $e+$f+$g+$h }; my $s1 = 0; for ^1_000_000 -> $a, $b, $c, $d { $s1 = foo($a, $b, $c, $d) }; say $s1; ||| sub bar($a is copy, $b is copy, $c is copy, $d is copy) { $a++; $b++; $c++; $d++; $a+$b+$c+$d }; my $s2 = 0; for ^1_000_000
¦HEAD: «===SORRY!=== Error while compiling /tmp/Zi08V4Zs4F
Missing block
at /tmp/Zi08V4Zs4F:1
------> +$b+$c+$d }; my $s2 = 0; for ^1_000_000 ⏏} ; my $b = Bench.new; $b.cmpthese(10, %
expecting any of:
block or pointy block
»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment