Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/head.raku Secret

Created Apr 14, 2021
Embed
What would you like to do?
multi fac($n where $n <= 1) { 1 }
multi fac($n) { $n * fac($n - 1) }
for ^100_000 {
fac(10)
}
say now - INIT now;
use nqp;
multi fac($n where $n <= 1) { 1 }
multi fac($n) { $n * nqp::dispatch('raku-call', &fac, $n - 1) }
for ^100_000 {
nqp::dispatch('raku-call', &fac, 10);
}
say now - INIT now;
jnthn@homedev:~/dev/rakudo$ ./rakudo-m where-head.raku
4.859758291
jnthn@homedev:~/dev/rakudo$ RAKUDO_NEW_DISP=1 ./rakudo-m where-new-disp.raku
1.337807436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment