YJIT Makes Rails 1.7x Faster
summary
Claimed speed goes from 1.7× to 1.8× faster when YJIT runs in real workloads and Shopify reports a 17% speedup on its storefront with overall production improvements of 10–20%. Enabling options are RUBY_YJIT_ENABLE=1 or RubyVM::YJIT.enable and Rails 7.2 can add an initializer. Ruby 3.3 implements VM send callbacks to avoid side exits (raising JIT coverage from ~32% to ~99%), compiles exception handlers, adds a register allocator and more C method specializations, and exposes YJIT memory tuning via YJIT exec_mem_size (default 48 MB).
AI-written summary · about
chapters (10)
- 0:00Introduction to YJIT
- 1:11How YJIT works
- 2:09Enabling YJIT in production
- 3:11Configuring memory usage
- 6:52Performance improvements in 3.3
- 8:54Addressing dispatch and caching
- 16:59Handling exceptions in YJIT
- 20:08Stack and register optimization
- 23:33Method inlining and C integration
- 27:02Conclusion and call to action
related talks
30mYJIT - Building a new JIT Compiler inside CRuby
17mYJIT: A Basic Block Versioning JIT Compiler
20mEvaluating YJIT’s Performance in a Production Context: A Pragmatic Approach
45mClosing Keynote
40mThe secret power of Ruby 2.6: JIT
47mBetter Ruby
41mPerformance Improvement of Ruby 2.7 JIT in Real World
30mUsing JRuby: What, When, How, and Why
