---
title: "Try Out YJIT for Faster Rubying"
description: "YJIT is Shopify’s just-in-time compiler for CRuby, designed to convert frequently used code into optimized native machine code. Early results include a 20% or more improvement on a simple hello, world Rails benchmark, while production-app benchmarking and one real web service showed about a 6% speedup on a small percentage of traffic. The guide covers building a YJIT-enabled Ruby from source with Autoconf, make, OpenSSL, and GCC or Clang, then switching to it with a Ruby version manager and enabling YJIT explicitly. It shows how to verify installation, compare test and benchmark runs, and collect runtime statistics about generated code, compiled ISEQs, and interpreter versus YJIT instruction execution. The implementation ran Shopify’s full unit tests, similar GitHub tests, and limited production traffic, but remains in progress and invites issue reports about crashes, errors, and speed."
---

# Try Out YJIT for Faster Rubying

[Shopify](https://yomu.fyi/company/shopify) · 2023-10-18 · Oct 15, 2021

**Type:** Tutorial

## Summary

YJIT is Shopify’s just-in-time compiler for CRuby, designed to convert frequently used code into optimized native machine code. Early results include a 20% or more improvement on a simple hello, world Rails benchmark, while production-app benchmarking and one real web service showed about a 6% speedup on a small percentage of traffic. The guide covers building a YJIT-enabled Ruby from source with Autoconf, make, OpenSSL, and GCC or Clang, then switching to it with a Ruby version manager and enabling YJIT explicitly. It shows how to verify installation, compare test and benchmark runs, and collect runtime statistics about generated code, compiled ISEQs, and interpreter versus YJIT instruction execution. The implementation ran Shopify’s full unit tests, similar GitHub tests, and limited production traffic, but remains in progress and invites issue reports about crashes, errors, and speed.

## Context

Shopify is developing a new JIT implementation on top of CRuby and is assessing its maturity, stability, readiness for workplace use, and whether benchmark improvements translate into real-world benefits.

## Approach / What changed

Build CRuby from source with YJIT, verify that the compiler is installed and explicitly enabled, compare test and benchmark execution with and without it, and optionally compile with debugging or statistics flags. The post also describes evaluating YJIT on unit tests, production-app benchmarks, and a small percentage of real web-service traffic.

## Takeaways

- YJIT improved a simple hello, world Rails benchmark by 20% or more, while one real web service saw a speedup of about 6% on a small percentage of traffic.
- YJIT can be enabled through Ruby options or environment variables, and its installation can be checked with ruby --enable-yjit -v or by examining the YJIT module in irb.
- Compiling with RUBY\_DEBUG or YJIT\_STATS options exposes statistics such as the share of instructions handled by YJIT, generated code size, and the number of compiled ISEQs.

**Tags:** [Performance](https://yomu.fyi/topic/performance), [Testing](https://yomu.fyi/topic/testing)

- Source: [Shopify](https://shopify.engineering/yjit-faster-rubying)
- Source URL: https://shopify.engineering/yjit-faster-rubying
- Ingested by Yomu: 2026-08-30T15:28:57.609Z

[Read original post](https://shopify.engineering/yjit-faster-rubying)
