Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created June 15, 2014 16:49
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 jnthn/2050e5ed6e8991e24e53 to your computer and use it in GitHub Desktop.
Save jnthn/2050e5ed6e8991e24e53 to your computer and use it in GitHub Desktop.
class A {
has $!a;
method BUILD(:$a) {
$!a := $a;
}
method a() { $!a }
}
sub foo($obj) {
$obj.a == 42 || nqp::die('oops');
}
my int $i := 0;
my $x := A.new(a => 42);
while $i < 10000000 {
foo($x);
$i++;
}
No spesh: 5.31
Spesh (no inline): 4.73
Spesh (inline): 3.83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment