Honest question, I do not know Ruby's semantics well. But, as someone who has worked on many JITs in the past, how is it in these results, <i>three different</i> JITs failed at getting more than a 2x performance improvement? Normally, a JIT is a 10-20x improvement in performance, just from the simple fact of removing the interpreter dispatch loop. What am I missing?
Several points discussed in these comments are addressed by the author in the linked <a href="https://bugs.ruby-lang.org/issues/19420" rel="nofollow">https://bugs.ruby-lang.org/issues/19420</a>
I work everyday with Rails.<p>In my experience, Ruby is not super slow.<p>In my machine, I can create 1M of empty hashs on 0.17sec.<p><pre><code> Benchmark.measure{1000000.times{Hash.new}}
@total = 0.1706789999999998s
</code></pre>
It's very good for a dynamic language.<p>But ActiveRecord (and Rails) are incredibly slow.<p>In my machine in 0.17sec only 2000 Models can be created.<p><pre><code> Benchmark.measure{2000.times{User.new}}
@total = @total=0.17733399999999833.
</code></pre>
Some SQL+Network runs in less than 10ms, in these cases Active Models creation is slower than that.<p>Yes, Rails can be slower than database access.
Quite interesting. My takeaway is that it can be on par with YJIT or even outperform it despite being in early development.<p>Btw one project I work on switched to YJIT in production and there are no problems so far (but no noticeable perf gains either)
From compiler nerd point of view, this is great piece of work.<p>Another meta-circular JIT implementation, instead of going the tried and through path that most keep on trailing.<p>Looking forward how it evolves from there.
Does RJIT get JIT compiled... by itself? That would be lovely in the sense that as RJIT finds more optimizations to speed up code, it would become itself faster.
I'd definitely be more apt to have this as part of production system instead of the Rust one.<p>Rust has got to be the ugliest, most unfriendly programming language I've ever laid my eyes on. And I wrote Perl for 10+ years, so that's really quite a feat of aesthetics failure.<p>Anyhow, I'm pretty impressed with the performance thus far, I like the idea of having multiple JITs available for a single-language ecosystem, regardless of how disgusting the language used to implement them. I think having competition means that there will be a race to the bottom and towards the "center" of general work. It's already really cool to see how the different approaches have clear preferences of the tasks they excel at and where they fall short.<p>This is hugely valuable because it pushes Ruby forward for everybody, and will hopefully result in not only a faster Ruby for X, but a faster Ruby for everything, which is just an objectively good thing.<p>Python is in a weird spot in this arena, because it is very clearly and very strongly orienting itself to continue to dominate practical data science work, and that means the need for JITs to handle regular jobs like text munging and whatnot fall by the side in order for the latest NumPy and Jax stuff, whatever is the current hot shit in the AIverse. Ruby doesn't suffer from that because it's pretty solidly lodged in the web development sphere, while also having a capable presence in netsec tools, application scripting, and probably a few more areas that I'm not aware of.<p>If you're interested in some of cutting edge Python stuff, I'd recommend taking a look at exaloop/Codon. Codon will soon be able to output Python extensions that are compatible with Python's setuptools, so it will soon be possible to just include some .codon files with your project, use setup.py, and have decorators that can (literally) 100x your hot loops.