YJIT - Building a new JIT Compiler inside CRuby
summary
YJIT is a new JIT compiled into CRuby at Shopify that uses lazy basic block versioning and runtime value promotion to specialize machine code only for observed types. It targets Linux x86_64, adds about 300 MB of memory by default, lacks code GC and method inlining, and passes CRuby tests. Measured speedups include ~24% on railsbench, 3–5% in a small production rollout, and smaller or negative wins on short-lived tests or numeric-heavy workloads.
AI-written summary · about
chapters (13)
- 0:00Start
- 3:15Language Compatibility
- 4:52Logic for Method Calls in Ruby
- 6:20Lazy Basic Block Versioning
- 9:07Tail Duplication
- 10:28Runtime Value Promotion
- 11:15The Jit Compiler for Python
- 13:07Performance
- 15:16Compatibility
- 19:34Expectations and Limitations
- 20:57Garbage Collector
- 24:36Future Plans
- 26:09Conclusion
related talks
17mYJIT: A Basic Block Versioning JIT Compiler
20mEvaluating YJIT’s Performance in a Production Context: A Pragmatic Approach
20mBYOJ: Build your own JIT with Ruby
32mExperiments in sharing Java VM technology with CRuby
28mZJIT: The future of Ruby performance
37mKeynote: YJIT's Three Languages: the Fun of Code that Writes Code
40mThe secret power of Ruby 2.6: JIT
45mClosing Keynote
