Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created February 1, 2019 20:31
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/70b06b2713c088a5d287173da8442f32 to your computer and use it in GitHub Desktop.
Save Whateverable/70b06b2713c088a5d287173da8442f32 to your computer and use it in GitHub Desktop.
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