Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created March 31, 2018 12:36
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/0f9553ea25bb4b6af4f721733de3061e to your computer and use it in GitHub Desktop.
Save Whateverable/0f9553ea25bb4b6af4f721733de3061e to your computer and use it in GitHub Desktop.
benchable6
compare HEAD my class A { has $.payload; method instance { state $instance = self.bless; }; method modify($a) { $!payload = $a; }; submethod new{!!!} }; A.instance for ^1000000; ||| my class A { my $instance; has $.payload; method instance { unless $instance.defined { $instance = self.bless; }; $instance }; method modify($a) { $!payload = $a; }; submethod new{!!!} }; A.instance for ^1000000;
¦HEAD: «Benchmark:
Timing 10 iterations of 0, 1...
0: 1.5086 wallclock secs @ 6.6288/s (n=10)
1: 3.9938 wallclock secs @ 2.5039/s (n=10)
O---O--------O------O------O
| | Rate | 1 | 0 |
O===O========O======O======O
| 1 | 2.50/s | -- | -62% |
| 0 | 6.63/s | 165% | -- |
----------------------------
»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment