Re:Ruby Outperforms C: Breaking the Catch-22
by pull_my_finger on Wednesday August 30, 2023 @10:52AM
(#37323054)
In the Lua world, there's a project, Pallene[1], that aims to solve this problem in paricular[2].
[1]: https://github.com/pallene-lang/pallene
[2]: http://www.inf.puc-rio.br/~roberto/docs/pallene-sblp.pdf
From the article:
> In other words, we have a tight loop that makes many Ruby to C to Ruby calls. YJIT (as well as other JIT compilers) have a hard time optimizing these types of calls.
Basically the benchmark compares two Ruby gems, one which can be optimized and another which cannot.
And to much surprise, the gem that cannot be optimized performs worse.