ZJIT has been merged into Ruby | Rails at Scale
16-May-2025 3
Following Maxime’s presentation at RubyKaigi 2025, the Ruby developers meeting, and Matz-san’s approval, ZJIT has been merged into Ruby. Hurray! In this post, we will give a high-level overview of the project, which is very early in development.
ZJIT is a new just-in-time (JIT) Ruby compiler built into the reference Ruby implementation, YARV, by the same compiler group that brought you YJIT. We (Maxime Chevalier-Boisvert, Takashi Kokubun, Alan Wu, Max Bernstein, and Aiden Fox Ivey) have been working on ZJIT since the beginning of this year.
It’s different from YJIT in several ways:
Instead of compiling YARV bytecode directly to the low-level IR (LIR), it uses an high-level SSA-based intermediate representation (HIR)
Instead of compiling one basic block at a time, it compiles one entire method at a time
Instead of using lazy basic block versioning (LBBV) to profile types, it reads historical type information from the profiled interpreter
Instead of doing optimizations while lowering YARV to LIR, it has a high-level modular optimizer that works on HIR.
ZJIT has been merged into Ruby | Rails at Scale #ruby #rubydeveloper #rubyonrails #merged #Rails #Scale https://rubyonrails.ba/link/zjit-has-been-merged-into-ruby-rails-at-scale