When is JIT Faster Than A Compiler? - Shopify
Aug 11, 2022

Summary
This post explains the fundamental differences between Ahead-Of-Time (AOT) compilers and Just-In-Time (JIT) compilers, particularly in the context of dynamic languages like Ruby. It details how JIT compilers leverage runtime information and de-optimization to achieve performance gains that AOT compilers struggle with due to the need for static correctness. The author, working on YJIT for CRuby, highlights Ruby's dynamic nature as a challenge for AOT compilation and explains how JITs can make assumptions about code behavior that are later invalidated and corrected. The post also provides information on how to try out YJIT and its development status.
More from the YJIT Compiler for Ruby trail
- Contributing support for a Wasm instruction to Winch - Shopify
- Ruby 3.2’s YJIT is Production-Ready - Shopify
- Year in Review 2022: Tenderlove's Ruby and Rails Reflections and Predictions - Shopify
- Shopify Invests in Research for Ruby at Scale - Shopify
- Our Experience Porting the YJIT Ruby Compiler to Rust - Shopify