YJIT Compiler for Ruby
Ruby 3.2’s YJIT is Production-Ready - Shopify

Ruby 3.2’s YJIT is Production-Ready - Shopify

1/17/2023

What this post added

This post details the advancements in Shopify's YJIT compiler for Ruby, specifically highlighting its production readiness in Ruby 3.2. Key contributions include porting YJIT from C99 to Rust for improved safety and maintainability, significant reductions in memory usage (to approximately one-third of 3.1's overhead), and performance improvements leading to a 38% speedup on railsbench over the Ruby 3.2 interpreter. The post also announces the addition of ARM64 support, enabling native execution on platforms like Apple M1/M2 and Raspberry Pis. Further enhancements include faster instance variable access via object shapes, improved YJIT exit tracing, better support for various Ruby method calls, finer-grained constant cache invalidation, and the allocation of variable-sized objects for improved memory usage and performance. Shopify has successfully deployed YJIT globally on its SFR infrastructure, achieving 5-10% speedups.

Read the original post ↗