-
-
Save jnthn/742ffa9d1dce49186a7b524dce31436f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use nqp; | |
sub with-current-disp() { | |
my class C1 { | |
method m() { 'c1' } | |
} | |
my class C2 is C1 { | |
method m() { 'c2' ~ callsame() } | |
} | |
my class C3 is C2 { | |
method m() { 'c3' ~ callsame() } | |
} | |
my class C4 is C3 { | |
method m() { 'c4' ~ callsame() } | |
} | |
for ^1_000_000 { | |
C4.m | |
} | |
say "Current: " ~ now - ENTER now; | |
} | |
sub with-new-disp() { | |
my class C1 { | |
method m() { 'c1' } | |
} | |
my class C2 is C1 { | |
method m() { 'c2' ~ new-disp-callsame() } | |
} | |
my class C3 is C2 { | |
method m() { 'c3' ~ new-disp-callsame() } | |
} | |
my class C4 is C3 { | |
method m() { 'c4' ~ new-disp-callsame() } | |
} | |
for ^1_000_000 { | |
nqp::dispatch('raku-meth-call', C4, 'm', C4); | |
} | |
say "New: " ~ now - ENTER now; | |
} | |
with-current-disp(); | |
with-new-disp(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Current: 42.794793 | |
New: 6.3299149 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment