Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created March 14, 2022 09:43
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/0b0a6f6df5c5adf045811ffd397d92fa to your computer and use it in GitHub Desktop.
Save Whateverable/0b0a6f6df5c5adf045811ffd397d92fa to your computer and use it in GitHub Desktop.
benchable6
compare HEAD (^100000).reduce({ $^a + $^b }).say; ||| my $a = 0; for ^100000 { $a += $_ }; say $a;
¦HEAD: «Benchmark:
Timing 10 iterations of 0, 1...
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
0: 2.354 wallclock secs (2.324 usr 0.036 sys 2.360 cpu) @ 4.248/s (n=10)
(warning: too few iterations for a reliable count)
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
4999950000
1: 0.150 wallclock secs (0.152 usr 0.004 sys 0.156 cpu) @ 66.818/s (n=10)
(warning: too few iterations for a reliable count)
O---O--------O------O-------O
| | Rate | 0 | 1 |
O===O========O======O=======O
| 0 | 4.25/s | -- | 1476% |
| 1 | 66.8/s | -94% | -- |
O---O--------O------O-------O
»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment