-
-
Save jnthn/5b680295227394afda401623c61e2989 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
multi fallback(Any $x) { "a$x" } | |
multi fallback(Numeric $x) { "n" ~ callsame } | |
multi fallback(Real $x) { "r" ~ callsame } | |
multi fallback(Int $x) { "i" ~ callsame } | |
for ^1_000_000 { | |
fallback(4+2i); | |
fallback(4.2); | |
fallback(42); | |
} | |
say now - INIT now; |
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; | |
multi fallback(Any $x) { "a$x" } | |
multi fallback(Numeric $x) { "n" ~ new-disp-callsame } | |
multi fallback(Real $x) { "r" ~ new-disp-callsame } | |
multi fallback(Int $x) { "i" ~ new-disp-callsame } | |
for ^1_000_000 { | |
nqp::dispatch('raku-call', &fallback, 4+2i); | |
nqp::dispatch('raku-call', &fallback, 4.2); | |
nqp::dispatch('raku-call', &fallback, 42); | |
} | |
say now - INIT now; |
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
jnthn@homedev:~/dev/rakudo$ ./rakudo-m bench-head.raku | |
31.307494412 | |
jnthn@homedev:~/dev/rakudo$ RAKUDO_NEW_DISP=1 ./rakudo-m bench-new-disp.raku | |
11.467661091 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment