Brent Laabs
Sep 8, 2018 · 1 min read
^yl (function)      20.84796616
^yl (hyper function) 9.62774398
^yl (hyper method) 15.21649909
^yl (method) 13.52501513
^yl (race function) 9.91842848
^yl (race method) 16.18823983

That’s a sum of 10 trials each. I have a 2013 i7 MacBook… with 4 cores. That could be the difference. But notice how much faster the functional form runs! Method calls are late binding, but function calls the type can be inferred at compile time, which could remove some ops. Obviously there’s some optimization work to be done here, because these loops are 1M iterations, and the JIT should be able to pick that up earlier. My Rakudo is 4 days old, so maybe I need to update… optimization happens fast these days.

I’m actually not sure if race is implemented yet, differently than hyper, that is. It looks like a measurement error.

    Brent Laabs

    Written by