Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created April 1, 2019 09:53
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/03465d31b9122609cc723e3078fc4fc4 to your computer and use it in GitHub Desktop.
Save Whateverable/03465d31b9122609cc723e3078fc4fc4 to your computer and use it in GitHub Desktop.
benchable6
compare HEAD for (1..8) { next if $_ == 2; $_.say } ||| for (1..8).grep({ $_ != 2 }) { $_.say }
¦HEAD: «Benchmark:
Timing 10 iterations of 0, 1...
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
0: 0.0009 wallclock secs @ 11627.2271/s (n=10)
(warning: too few iterations for a reliable count)
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1
3
4
5
6
7
8
1: 0.0016 wallclock secs @ 6118.3761/s (n=10)
(warning: too few iterations for a reliable count)
O---O---------O-----O------O
| | Rate | 1 | 0 |
O===O=========O=====O======O
| 1 | 6120/s | -- | -47% |
| 0 | 11620/s | 90% | -- |
----------------------------
»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment