Hacker News new | past | comments | ask | show | jobs | submit login

I am liking all the performance improvement goodies on JIT and GC level.





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.


There'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://www.mmtk.io/


https://speed.yjit.org/

Railsbench is 5.8% faster with 3.4 over 3.3


Turns out YJIT is already 100%+ faster than non JIT in RailBench and ActiveRecord.

I 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.

There'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.

> 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.


Most likely not yet there, but for applications implemented in Ruby it is certainly an improvement for overall usability experience.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: