3 ms·
1. Wondering 3.4 JIT performance vs 3.3 JIT on production rails. 2. Also wondering what upside could Ruby / Rails gain on a hypothetical Java Generational ZGC
by ksec 2y ago
1. Wondering 3.4 JIT performance vs 3.3 JIT on production rails.
2. Also wondering what upside could Ruby / Rails gain on a hypothetical Java Generational ZGC like GC? Or if current GC is even a bottleneck anywhere in most Rails applications.
- pjmlp 2y agoMost likely not yet there, but for applications implemented in Ruby it is certainly an improvement for overall usability experience.
- neonsunset 2y ago> Also wondering what upside could Ruby / Rails gain on a hypothetical Java Generational ZGC like GC? Or if current GC is even a bottleneck anywhere in most Rails applications. Ruby's GC needs are likely to be very far from the needs of JVM and .NET languages, so I expect it to be both much simpler but also relatively sufficient for the time being. Default Ruby implementation uses GIL so the resulting allocation behavior is likely to be nowhere near the saturation of throughput of a competent GC design. Also, if you pay attention to the notes discussing the optimizations implemented in Ruby 3.4, you'll see that such JIT design is effectively in its infancy - V8, RyuJIT (and its predecessors) and OpenJDK's HotSpot did all this as a bare minimum more than 10 years ago. This is a welcome change for the Ruby ecosystem itself I guess but it's not going to change the performance ladder.
- vidarh 2y agoThere's TruffleRuby (built on Graal) and JRuby if you want to explore that. They're not viable for everything, but they can be much faster.
- viraptor 2y agoI would expect some measurable improvement given how object-happy rails programming is. It's not uncommon to see 3 layers of models just wrapping a single variable - "objects that could've been functions". Some kind of tiers like generations or per-request pools would be amazing.
- sosodev 2y agohttps://speed.yjit.org/ https://speed.yjit.org/ Railsbench is 5.8% faster with 3.4 over 3.3
- ksec 2y agoTurns out YJIT is already 100%+ faster than non JIT in RailBench and ActiveRecord.
- riffraff 2y agoThere's ongoing work to allow pluggable GCs, and specifically to allow using MMTk which would be IBM's Jikes GC https://bugs.ruby-lang.org/issues/20470 https://bugs.ruby-lang.org/issues/20470 https://www.mmtk.io/ https://www.mmtk.io/
- pjmlp 2y agoNot quite, MMTk was rewriten from Java into Rust. So already something else from Jikes days.