B
Benoit Daloze
eregon.me · Personal blog · on HN since 2016
Benoit Daloze, a TruffleRuby developer, writes about Ruby implementation performance, benchmarks, compatibility and the Ruby spec suite.
What HN saysHN commenters cite his benchmark comparing CRuby, YJIT, JRuby and TruffleRuby, with one finding TruffleRuby faster than YJIT and another doubting a graph.
21HN people shared it
11linked it in comments
15stories submitted
235story points
12 months agolast shared
2016people per year2026
Most-shared posts
- 1Benchmarking CRuby, MJIT, YJIT, JRuby, and TruffleRuby11 people · 92 points · first shared 2022 · 29 comments on HN
- 2The Ruby Spec Suite Compatibility Report4 people · 2 points · first shared 2020 · discussion on HN
- 3Running Optcarrot, a Ruby NES Emulator, at 150 Fps with the GUI2 people · 60 points · first shared 2016 · 11 comments on HN
- 4Matching Regexps 200 Times Faster2 people · 33 points · first shared 2025 · 12 comments on HN
- 5Benchmarking Ruby Parsers2 people · 33 points · first shared 2024 · 3 comments on HN
- 6TruffleRuby Native: Fast Even for Short Scripts2 people · 6 points · first shared 2018 · discussion on HN
- 7Contributions to Ruby/spec by Ruby implementation1 people · 5 points · first shared 2025 · discussion on HN
- 8The Delegation Challenge of Ruby 2.71 people · 2 points · first shared 2019 · discussion on HN
- 9TruffleRuby's Startup Time Became Faster Than MRI's1 people · 2 points · first shared 2019 · discussion on HN
- 10From interpreting c extensions to compiling them.pdf1 people · first shared 2025
What HN people wrote when they linked it
eregon · 2022-01-06
Startup is likely to be worse, because it typically runs a lot of different code for not long and the JIT might not have enough time to optimize much of that. OTOH the JIT needs to learn what the program is doing, i.e., profile it in a sense, and that has a cost on interpreter speed.
Still these numbers are worse than expected, especially [object validation], so if there is a way to reproduce it'd be great if you can open an issue about it.
Persisting the JITed code is what we think can solve the slower startup entirely:
https://www.graalvm.org/graalvm-as-a-platform/language-implementation-…
Also other things mentioned in https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t…
pjmlp · 2025-11-06
Here, I don't know all the details, just remember having seen some talks about this in the past.
It builds on top of this effort, https://medium.com/graalvm/graalvm-llvm-toolchain-f606f995bf
"From Interpreting C Extensions to Compiling Them"
https://eregon.me/blog/assets/research/from-interpreting-c-extensions-…
foobazgt · 2025-02-12
The author pans meta-tracing and shows a graph of TruffleRuby having really crazy runtime behavior. However, it looks extremely suspicious - like the kind of thing you'd see if there was a memory leak and the garbage collector was running constantly.
Most people seem really excited about the results coming out of Graal and TruffleRuby seems to have some really impressive results in general, so the graph is surprising. It's also missing a bunch of details, so it's hard to speak to its voracity - for example, what are the different versions of the runtimes, what flags were used, on what hardware?
As a counter example, there's a different (admittedly old) result where TruffleRuby beats cruby on the same benchmark by 4.38x. https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t…
mike_hearn · 2023-09-17
There are lots. Usually these days, also comparing with TruffleRuby, which also runs on the JVM.
This one is a couple years old now but you get the idea:
https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t…
I don't know where to find more up to date benchmarks.
the-alchemist · 2023-01-17
I don't quite understand the YJIT excitement. A few benchmarks show that TruffleRuby generally beats YJIT, sometimes by a 10x margin.
[0]: https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t… says
brasic · 2022-12-26
TruffleRuby is leading the pack here: https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t…
perrylaj · 2022-11-07
I haven't stayed up to date, but last benchmarks I saw, truffleruby was not just faster than any other implementation, it was significantly so in many cases. It would be interesting to see if the results hold up in larger scale real world usage.
https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t…
chrisseaton · 2022-04-26
> the newly added Ruby jit that you can optionally turn on is faster than Graal
No TruffleRuby is still very much faster than any other Ruby JIT. YJIT does startup faster yes that's the goal.
https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t…
fuzzythinker · 2022-04-20
Here's a benchmark [1] done in Jan'22 against many ruby implementations, truffleRuby [2] seems to be way ahead in most, and at least ahead in all. Why truffleRuby isn't talk about much here?
[1] https://eregon.me/blog/2022/01/06/benchmarking-cruby-mjit-yjit-jruby-t…
[2] https://github.com/oracle/truffleruby
dwheeler · 2021-01-01
Artichoke is interesting, but it's still really young and doesn't have a lot of compatibility with MRuby yet: https://eregon.me/blog/2020/06/27/ruby-spec-compatibility-report.html
I don't know of any reason it can't grow to be much more compatible.
There's a 2019 video about Artichoke:
https://www.youtube.com/watch?v=QMni48MBqFw
flavorjones · 2022-10-12
Howdy, I'm on the Shopify team that is working on both pitchfork and a few different performance-improvement projects for Ruby. There's a ton of activity around Ruby performance right now!
I think we're entering a period of increased experimentation and rapid evolution as demonstrated by projects like YJIT[1][2], improved inline caching[3][4] and Object Shapes[5] (also used by V8), and variable-width allocation[6][7], and smaller improvements like better constant invalidation[8]. Significant investments in TruffleRuby[9] are still going on by Oracle, Shopify, and other companies.
And recently, Takashi Kokubun gave a talk at Ruby Kaigi about the future of JIT compilers in Ruby that gives a peek at a whole new set of optimizations Ruby can work on (as well as some performance comparisons against other interpreted languages)[10]. You may be surprised to see how well Ruby (with the JIT enabled) performs compared to Python 3.
All of which is to say, I think there's quite a bit of performance improvement being made in recent Rubies, and that trend will likely continue for quite some time.
update And I forgot to mention that some very notable computer science researchers and their teams are working in the Ruby community now![11]
[1]: https://news.ycombinator.com/item?id=28938446)
[2]: https://speed.yjit.org/
[3]: https://bugs.ruby-lang.org/issues/18943
[4]: https://bugs.ruby-lang.org/issues/18875
[5]: https://bugs.ruby-lang.org/issues/18776
[6]:…