Details for Benchmarks at
YJIT metrics from the yjit-bench suite
On Railsbench specifically, YJIT is 22.0% faster than CRuby!
¶Performance on Headline Benchmarks
¶Memory Usage on Headline Benchmarks
¶Performance on Other Benchmarks

¶Memory Usage on Other Benchmarks
¶Performance on MicroBenchmarks
¶Memory Usage on MicroBenchmarks
¶Want Raw Graphs and CSV?
¶Benchmarks Speed Details
bench | No JIT (ms) | No JIT RSD | MJIT3.0 (ms) | MJIT3.0 RSD | YJIT (ms) | YJIT RSD | MJIT3.0 spd | MJIT3.0 spd RSD | YJIT spd | YJIT spd RSD | % in YJIT |
---|---|---|---|---|---|---|---|---|---|---|---|
activerecord | 145.7 | 1.27% | 154.5 | 0.86% | 107.3 | 0.45% | 0.94x | 1.53% | 1.36x | 1.34% | 80.96% |
hexapdf | 2847.4 | 0.76% | 2740.1 | 2.09% | 2184.0 | 1.54% | 1.04x | 2.22% | 1.30x | 1.72% | 72.00% |
liquid-render | 174.0 | 1.24% | 161.3 | 2.12% | 124.4 | 2.02% | 1.08x | 2.46% | 1.40x | 2.37% | 71.70% |
157.4 | 0.15% | 147.6 | 0.38% | 139.3 | 0.36% | 1.07x | 0.41% | 1.13x | 0.39% | 98.31% | |
psych-load | 2232.8 | 0.19% | 1886.2 | 2.67% | 1597.4 | 0.10% | 1.18x | 2.67% | 1.40x | 0.22% | 82.02% |
railsbench | 2921.0 | 1.13% | 3016.7 | 1.20% | 2394.1 | 1.89% | 0.97x | 1.65% | 1.22x | 2.21% | 79.87% |
binarytrees | 367.7 | 0.06% | 264.0 | 0.64% | 293.3 | 2.66% | 1.39x | 0.64% | 1.25x | 2.66% | 84.27% |
fannkuchredux | 5461.1 | 0.23% | 3988.5 | 0.28% | 5568.0 | 0.04% | 1.37x | 0.36% | 0.98x | 0.24% | 0.02% |
jekyll | 8383.6 | 1.58% | 8273.0 | 1.40% | 7466.4 | 1.89% | 1.01x | 2.11% | 1.12x | 2.47% | 78.42% |
lee | 1100.6 | 0.74% | 869.2 | 1.19% | 783.3 | 1.03% | 1.27x | 1.40% | 1.41x | 1.27% | 99.92% |
nbody | 108.9 | 0.31% | 58.9 | 0.62% | 75.5 | 0.06% | 1.85x | 0.69% | 1.44x | 0.31% | 100.00% |
optcarrot | 4968.8 | 0.56% | 4246.3 | 0.76% | 3146.5 | 0.47% | 1.17x | 0.95% | 1.58x | 0.73% | 96.13% |
30k_ifelse | 2317.0 | 0.13% | 2221.6 | 3.32% | 331.0 | 0.17% | 1.04x | 3.32% | 7.00x | 0.21% | 99.99% |
30k_methods | 6031.9 | 0.04% | 5836.7 | 0.09% | 758.1 | 0.03% | 1.03x | 0.10% | 7.96x | 0.05% | 100.00% |
cfunc_itself | 89.7 | 0.16% | 57.2 | 0.20% | 39.0 | 0.26% | 1.57x | 0.25% | 2.30x | 0.30% | 100.00% |
fib | 192.8 | 0.04% | 62.5 | 0.03% | 52.0 | 0.06% | 3.08x | 0.05% | 3.71x | 0.07% | 100.00% |
getivar | 86.6 | 0.10% | 97.3 | 0.10% | 36.3 | 0.03% | 0.89x | 0.14% | 2.39x | 0.10% | 86.63% |
keyword_args | 241.0 | 0.03% | 189.1 | 0.04% | 46.1 | 0.33% | 1.27x | 0.05% | 5.23x | 0.33% | 100.00% |
respond_to | 229.2 | 0.29% | 200.7 | 0.52% | 164.1 | 0.33% | 1.14x | 0.59% | 1.40x | 0.44% | 100.00% |
setivar | 70.9 | 0.04% | 73.0 | 0.10% | 42.2 | 0.04% | 0.97x | 0.11% | 1.68x | 0.06% | 88.40% |
RSD is relative standard deviation - the standard deviation divided by the mean, expressed as a percentage.
% in YJIT is the percentage of instructions that complete in YJIT rather than exiting to the non-JITted interpreter. YJIT performs better when this is higher.
Speedup is relative to interpreted CRuby. So an "MJIT speedup" of 1.21x means MJIT runs at 1.21 times the iters/second of CRuby with JIT disabled.
You can find our benchmark code in the yjit-bench Github repo and the yjit-extra-benchmarks Github repo.
Our benchmark-runner and reporting code is in the yjit-metrics Github repo.
Tested Ruby version for YJIT and No-JIT: ruby 3.1.0dev (2021-10-14T20:49:33Z main 6b2ff13ba2) +YJIT [x86_64-linux]
Tested Ruby version for Ruby 3.0 MJIT: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) +JIT [x86_64-linux]
¶Benchmark Memory Usage Details

¶Number of Iterations and Warmups Tested
bench | No JIT warmups | No JIT iters | MJIT3.0 warmups | MJIT3.0 iters | YJIT warmups | YJIT iters |
---|---|---|---|---|---|---|
activerecord | 10 | 128 | 10 | 120 | 10 | 177 |
hexapdf | 10 | 10 | 10 | 10 | 10 | 10 |
liquid-render | 10 | 105 | 10 | 114 | 10 | 151 |
10 | 117 | 10 | 125 | 10 | 133 | |
psych-load | 10 | 10 | 10 | 10 | 10 | 10 |
railsbench | 10 | 10 | 10 | 10 | 10 | 10 |
binarytrees | 10 | 45 | 10 | 66 | 10 | 59 |
fannkuchredux | 10 | 10 | 10 | 10 | 10 | 10 |
jekyll | 10 | 10 | 10 | 10 | 10 | 10 |
lee | 10 | 10 | 10 | 13 | 10 | 16 |
nbody | 10 | 174 | 10 | 325 | 10 | 255 |
optcarrot | 10 | 10 | 10 | 10 | 10 | 10 |
30k_ifelse | 10 | 10 | 10 | 10 | 10 | 51 |
30k_methods | 10 | 10 | 10 | 10 | 10 | 17 |
cfunc_itself | 10 | 214 | 10 | 339 | 10 | 503 |
fib | 10 | 94 | 10 | 308 | 10 | 375 |
getivar | 10 | 221 | 10 | 196 | 10 | 530 |
keyword_args | 10 | 74 | 10 | 96 | 10 | 424 |
respond_to | 10 | 78 | 10 | 90 | 10 | 112 |
setivar | 10 | 273 | 10 | 264 | 10 | 458 |
Different Ruby configurations want different amounts of warmup. With no JIT, CRuby needs hardly any. YJIT and MJIT 3.0 both warm up quite quickly, while MJIT in 3.1 often slows down for a time as it compiles, after an unpredictable delay.
¶Benchmark YJIT Stats
Hover your cursor over the benchmark names for descriptions of each benchmark.
bench | Exit Report | Inline | Outlined | Comp iSeqs | Comp Blocks | Inval | Inval Ratio | Bind Alloc | Bind Set | Const Bumps |
---|---|---|---|---|---|---|---|---|---|---|
activerecord | (click) | 1113370 | 867117 | 185 | 1160 | 0 | 0% | 0 | 0 | 0 |
hexapdf | (click) | 975617 | 816619 | 602 | 7877 | 675 | 8% | 0 | 0 | 320 |
liquid-render | (click) | 459412 | 375549 | 143 | 1288 | 94 | 7% | 0 | 0 | 1 |
(click) | 978778 | 756639 | 337 | 5011 | 129 | 2% | 0 | 0 | 39 | |
psych-load | (click) | 185002 | 149179 | 56 | 409 | 1 | 0% | 0 | 0 | 0 |
railsbench | (click) | 2565041 | 1998326 | 1293 | 9570 | 262 | 2% | 0 | 0 | 26 |
binarytrees | (click) | 113533 | 89826 | 9 | 49 | 0 | 0% | 0 | 0 | 0 |
fannkuchredux | (click) | 129917 | 103829 | 6 | 203 | 0 | 0% | 0 | 0 | 0 |
jekyll | (click) | 1960538 | 1630556 | 336 | 3721 | 174 | 4% | 0 | 0 | 0 |
lee | (click) | 234794 | 181551 | 85 | 1091 | 114 | 10% | 1 | 0 | 13 |
nbody | (click) | 123261 | 97934 | 8 | 149 | 0 | 0% | 0 | 0 | 0 |
optcarrot | (click) | 459837 | 430104 | 196 | 3567 | 20 | 0% | 0 | 0 | 0 |
30k_ifelse | (click) | 5561469 | 4891133 | 9261 | 57795 | 0 | 0% | 0 | 0 | 0 |
30k_methods | (click) | 2117693 | 1816572 | 5780 | 19352 | 0 | 0% | 0 | 0 | 0 |
cfunc_itself | (click) | 111997 | 88265 | 6 | 40 | 0 | 0% | 0 | 0 | 0 |
fib | (click) | 109885 | 87444 | 6 | 29 | 0 | 0% | 0 | 0 | 0 |
getivar | (click) | 112253 | 90679 | 6 | 56 | 0 | 0% | 0 | 0 | 0 |
keyword_args | (click) | 113213 | 89399 | 7 | 42 | 0 | 0% | 0 | 0 | 0 |
respond_to | (click) | 114557 | 90187 | 6 | 55 | 0 | 0% | 0 | 0 | 0 |
setivar | (click) | 112253 | 88988 | 6 | 29 | 0 | 0% | 0 | 0 | 0 |
YJIT stats correspond to the YJIT stats exit report.
Note: currently, all stats are collected on x86_64, not ARM.
¶Raw JSON data files
All graphs and table data in this page comes from processing these data files, which come from benchmark runs.