The design and implementation of ZJIT & the next five years
summary
Zjit compiles Ruby at runtime using an SSA HIR, a lower-level LI for data motion and native Intel/ARM backends, inserting runtime guards and patch points to fall back to the interpreter. Current wins: faster microbenchmarks, shape-based IVar loads, and basic method inlining; remaining issues: many C calls (array min/include, range each, struct init) still block whole-program speedups and some allocations aren’t elided. Tooling includes Perfetto trace viewer and a Misilla-based visualizer; target is a 5× speedup goal with inlining, escape analysis, and background compilation.
AI-written summary · about
chapters (15)
- 0:00Introduction and speaker background
- 1:06What is a JIT compiler
- 3:13ZJIT design and differences from WJIT
- 4:38Ruby semantics and object shapes
- 5:42High-level IR and optimizations
- 8:53Current ZJIT features and roadmap
- 9:58Performance tracing with Perfetto demo
- 11:00Performance benchmarks and regressions
- 12:03Ruby performance dreams and canary examples
- 15:54Loop and method call optimizations
- 18:01Allocation and escape analysis
- 19:27Path to 5x performance with inlining
- 22:35Future optimizations and runtime cooperation
- 24:21Advanced optimizations and wild ideas
- 25:45Conclusion and team credits
related talks
28mZJIT: The future of Ruby performance
20mEvaluating YJIT’s Performance in a Production Context: A Pragmatic Approach
30mYJIT - Building a new JIT Compiler inside CRuby
37mKeynote: YJIT's Three Languages: the Fun of Code that Writes Code
20mBYOJ: Build your own JIT with Ruby
57mRuby: 2020
40mThe secret power of Ruby 2.6: JIT
34mFaster FFI For Ruby
