YJIT Benchmarks

Details for Benchmarks at 2023-04-18 06:08:33 GMT

YJIT metrics from the yjit-bench suite using Ruby d8a6db7292.

Overall YJIT is 48.3% faster than interpreted CRuby!
On Railsbench specifically, YJIT is 51.5% faster than CRuby!

Performance on Headline Benchmarks

Select Platform
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 No JIT YJIT activerecord hexapdf liquid-c liquid-compile liquid-render mail psych-load railsbench ruby-lsp sequel
Speed of each Ruby implementation relative to the baseline CRuby measurement. Higher is better.

Memory Usage on Headline Benchmarks

Select Platform
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 CRuby 3.3.0dev YJIT 3.3.0dev activerecord hexapdf liquid-c liquid-compile liquid-render mail psych-load railsbench ruby-lsp sequel geomean*
Memory usage of each Ruby implementation relative to the baseline CRuby measurement. Lower is better.

Performance on Other Benchmarks

Select Platform
Speed of each Ruby implementation relative to the baseline CRuby measurement. Higher is better.

Memory Usage on Other Benchmarks

Select Platform
0.0 0.2 0.4 0.6 0.8 1.0 CRuby 3.3.0dev YJIT 3.3.0dev binarytrees chunky_png erubi erubi_rails etanni fannkuchredux lee nbody optcarrot ruby-json rubykon geomean*
Memory usage of each Ruby implementation relative to the baseline CRuby measurement. Lower is better.

Performance on MicroBenchmarks

Select Platform
0.0 2.0 4.0 6.0 8.0 10.0 No JIT YJIT 30k_ifelse 30k_methods cfunc_itself fib getivar keyword_args respond_to setivar setivar_object setivar_young str_concat throw
Speed of each Ruby implementation relative to the baseline CRuby measurement. Higher is better.

Memory Usage on MicroBenchmarks

Select Platform
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 CRuby 3.3.0dev YJIT 3.3.0dev 30k_ifelse 30k_methods cfunc_itself fib getivar keyword_args respond_to setivar setivar_object setivar_young str_concat throw geomean*
Memory usage of each Ruby implementation relative to the baseline CRuby measurement. Lower is better.

Want Raw Graphs and CSV?

Benchmarks Speed Details

Select Platform
bench No JIT (ms) No JIT RSD YJIT (ms) YJIT RSD YJIT spd YJIT spd RSD % in YJIT
activerecord 77.7 0.48% 41.6 0.88% 1.87x 1.00% 94.75%
hexapdf 3187.8 0.83% 2007.7 2.12% 1.59x 2.28% 90.27%
liquid-c 79.7 1.30% 58.1 1.99% 1.37x 2.37% 93.67%
liquid-compile 74.7 2.79% 55.0 0.52% 1.36x 2.84% 93.96%
liquid-render 197.4 1.43% 101.4 2.83% 1.95x 3.17% 88.83%
mail 167.0 1.57% 127.3 0.24% 1.31x 1.59% 99.14%
psych-load 2425.6 0.06% 1811.8 0.08% 1.34x 0.10% 99.99%
railsbench 2717.2 0.74% 1793.5 1.15% 1.52x 1.37% 93.82%
ruby-lsp 80.5 8.29% 56.8 20.72% 1.42x 22.32% 79.11%
sequel 85.8 0.15% 67.7 0.32% 1.27x 0.36% 96.08%
binarytrees 458.8 0.13% 224.4 0.10% 2.04x 0.16% 100.00%
chunky_png 961.7 0.04% 604.4 0.06% 1.59x 0.08% 100.00%
erubi 297.7 0.67% 246.2 0.94% 1.21x 1.16% 100.00%
erubi_rails 25.5 2.52% 15.0 3.54% 1.69x 4.35% 92.21%
etanni 404.1 0.46% 403.8 0.45% 1.00x 0.65% 7.03%
fannkuchredux 2118.4 0.11% 754.7 0.05% 2.81x 0.12% 90.92%
lee 1221.9 0.26% 876.5 0.36% 1.39x 0.45% 99.97%
nbody 130.0 0.08% 68.4 0.09% 1.90x 0.12% 100.00%
optcarrot 5877.3 0.64% 2197.2 0.63% 2.67x 0.90% 96.78%
ruby-json 3590.8 0.18% 3092.2 0.10% 1.16x 0.20% 99.35%
rubykon 12533.1 0.38% 6500.3 0.36% 1.93x 0.53% 99.78%
30k_ifelse 2313.8 0.01% 361.2 0.06% 6.41x 0.06% 99.99%
30k_methods 7053.7 0.02% 857.6 0.03% 8.22x 0.04% 100.00%
cfunc_itself 105.7 0.21% 39.0 0.25% 2.71x 0.32% 100.00%
fib 249.6 0.06% 44.4 0.12% 5.63x 0.13% 100.00%
getivar 99.1 0.27% 21.2 0.14% 4.68x 0.31% 97.87%
keyword_args 283.1 0.10% 47.9 0.11% 5.91x 0.15% 100.00%
respond_to 273.5 0.43% 25.3 0.69% 10.80x 0.82% 100.00%
setivar 66.7 0.24% 12.0 0.08% 5.56x 0.25% 98.74%
setivar_object 103.1 1.53% 46.7 4.35% 2.21x 4.61% 95.24%
setivar_young 100.2 0.44% 44.2 2.09% 2.27x 2.14% 95.60%
str_concat 82.3 0.69% 42.9 1.50% 1.92x 1.65% 99.67%
throw 29.4 0.17% 22.9 0.24% 1.29x 0.30% 64.81%

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.3.0dev (2023-04-18T03:38:14Z :detached: d8a6db7292) +YJIT [x86_64-linux]

Benchmark Memory Usage Details

Select Platform

Number of Iterations and Warmups Tested

Benchmark YJIT Stats

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.