Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created Feb 1, 2019
Embed
What would you like to do?
benchable6
compare HEAD use nqp; my $a = "foo"; my $b; for ^10_000_000 { $b = nqp::if(nqp::istype($a, Str), $a, $a.Str) }; say $b; ||| use nqp; my $a = "foo"; my $b; for ^10_000_000 { $b = $a.Str }; say $b;
¦HEAD: «Benchmark:
Timing 10 iterations of 0, 1...
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
0: 9.8118 wallclock secs @ 1.0192/s (n=10)
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
1: 5.2851 wallclock secs @ 1.8921/s (n=10)
O---O--------O-----O------O
| | Rate | 0 | 1 |
O===O========O=====O======O
| 0 | 1.02/s | -- | -46% |
| 1 | 1.89/s | 86% | -- |
---------------------------
»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment