Using Perfetto in ZJIT | Rails at Scale
03-Apr-2026 276
We added Perfetto tracing support to ZJIT so we could visualize and query slow events. Take a look at the pretty colors and see how you can add this to your system too.The first rule of just-in-time compilers is: you stay in JIT code. The second rule of JIT is: you STAY in JIT code!
When control leaves the compiled code to run in the interpreter—what the ZJIT team calls either a “side-exit” or a “deopt”, depending on who you talk to—things slow down. In a well-tuned system, this should happen pretty rarely. Right now, because we’re still bringing up the compiler and runtime system, it happens more than we would like.
We’re reducing the number of exits over time.
.
Using Perfetto in ZJIT | Rails at Scale #ruby #rubydeveloper #rubyonrails #Using #Perfetto #Rails #Scale https://www.rubyonrails.ba/link/using-perfetto-in-zjit-rails-at-scale