YJIT Benchmarks

Details for Benchmarks at 2021-12-01 07:10:23 GMT

YJIT metrics from the yjit-bench suite

Overall YJIT is 28.0% faster than interpreted CRuby!
On Railsbench specifically, YJIT is 19.1% faster than CRuby!

Performance on Headline Benchmarks

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

Memory Usage on Headline Benchmarks

0.0 2.0 4.0 6.0 8.0 CRuby 3.1.0dev MJIT3.0 MJIT YJIT 3.1.0dev activerecord hexapdf liquid-render mail psych-load railsbench geomean*
Memory usage of each Ruby implementation relative to the baseline CRuby measurement. Lower is better.

Performance on Other Benchmarks

0.0 0.5 1.0 1.5 2.0 No JIT MJIT3.0 MJIT YJIT binarytrees erubi erubi_rails fannkuchredux jekyll lee nbody optcarrot rubykon
Speed of each Ruby implementation relative to the baseline CRuby measurement. Higher is better.

Memory Usage on Other Benchmarks

0.0 2.0 4.0 6.0 8.0 10.0 CRuby 3.1.0dev MJIT3.0 MJIT YJIT 3.1.0dev binarytrees erubi erubi_rails fannkuchredux jekyll lee nbody optcarrot rubykon geomean*
Memory usage of each Ruby implementation relative to the baseline CRuby measurement. Lower is better.

Performance on MicroBenchmarks

0.0 2.0 4.0 6.0 8.0 No JIT MJIT3.0 MJIT YJIT 30k_ifelse 30k_methods cfunc_itself fib getivar keyword_args respond_to setivar
Speed of each Ruby implementation relative to the baseline CRuby measurement. Higher is better.

Memory Usage on MicroBenchmarks

Memory usage of each Ruby implementation relative to the baseline CRuby measurement. Lower is better.

Want Raw Graphs and CSV?

Benchmarks Speed Details

Benchmark Memory Usage Details

bench CRuby 3.1.0dev mem (MiB) MJIT3.0 mem (MiB) MJIT mem (MiB) YJIT 3.1.0dev mem (MiB) Inline Code Outlined Code YJIT Mem overhead
activerecord 63 60 71 322 1 1 405.8%
hexapdf 338 347 672 2 1 98.6%
liquid-render 31 29 35 290 1 1 830.4%
mail 48 48 51 307 1 1 540.2%
psych-load 39 35 47 295 1 1 650.6%
railsbench 103 104 137 377 3 2 265.1%
binarytrees 28 33 27 285 1 1 894.3%
erubi 72 72 108 336 1 1 364.6%
erubi_rails 110 118 119 370 3 2 235.2%
fannkuchredux 23 21 23 280 1 1 1092.5%
jekyll 906 1454 2144 1770 2 2 95.2%
lee 36 32 37 289 1 1 697.7%
nbody 23 22 23 280 1 1 1088.2%
optcarrot 74 79 84 340 1 1 356.7%
rubykon 59 80 72 319 1 1 437.8%
30k_ifelse 63 62 198 348 6 5 444.7%
30k_methods 56 55 180 323 3 2 475.9%
cfunc_itself 23 22 23 280 1 1 1081.3%
fib 23 21 23 280 1 1 1084.3%
getivar 23 22 23 280 1 1 1085.4%
keyword_args 23 22 23 280 1 1 1087.7%
respond_to 23 22 23 280 1 1 1090.3%
setivar 23 22 23 280 1 1 1084.8%

Memory is shown in mebibytes (1024 * 1024 bytes.)

Older YJIT allocated an additional 256MiB for generated code. Current YJIT allocates executable memory on demand, so this overhead should no longer be present.

Number of Iterations and Warmups Tested

bench No JIT warmups No JIT iters MJIT3.0 warmups MJIT3.0 iters MJIT warmups MJIT iters YJIT warmups YJIT iters
activerecord 5 184 20 184 75 184 20 184
hexapdf 5 15 20 15 20 15
liquid-render 5 169 20 169 75 169 20 169
mail 5 140 20 140 75 140 20 140
psych-load 5 15 20 15 75 15 20 15
railsbench 5 15 20 15 75 15 20 15
binarytrees 5 85 20 85 75 85 20 85
erubi 5 50 20 50 75 50 20 50
erubi_rails 5 595 20 595 75 595 20 595
fannkuchredux 5 15 20 15 55 15 20 15
jekyll 5 15 20 15 35 15 20 15
lee 5 26 20 26 75 26 20 26
nbody 5 343 20 343 75 343 20 343
optcarrot 5 15 20 15 75 15 20 15
rubykon 5 15 20 15 44 15 20 15
30k_ifelse 5 62 20 62 75 62 20 62
30k_methods 5 26 20 26 44 26 20 26
cfunc_itself 5 512 20 512 75 512 20 512
fib 5 383 20 383 75 383 20 383
getivar 5 563 20 563 75 563 20 563
keyword_args 5 423 20 423 75 423 20 423
respond_to 5 127 20 127 75 127 20 127
setivar 5 510 20 510 75 510 20 510

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) 987626 744467 185 1180 0 0% 0 0 0
hexapdf (click) 1096426 874296 595 8020 614 7% 0 0 321
liquid-render (click) 492485 382296 143 1434 96 6% 0 0 1
mail (click) 869290 643296 325 5223 124 2% 0 0 39
psych-load (click) 310625 241972 57 423 1 0% 0 0 0
railsbench (click) 2588642 1932906 1293 9684 263 2% 0 0 26
binarytrees (click) 163123 125049 9 49 0 0% 0 0 0
erubi (click) 288225 224452 8 35 0 0% 0 0 0
erubi_rails (click) 2408418 1732014 260 1985 16 0% 0 0 3
fannkuchredux (click) 179123 137059 6 203 0 0% 0 0 0
jekyll (click) 1904234 1514792 336 3935 179 4% 0 0 0
lee (click) 349802 272559 44 562 67 11% 0 0 12
nbody (click) 173107 132369 8 149 0 0% 0 0 0
optcarrot (click) 501939 431775 196 3567 20 0% 0 0 0
rubykon (click) 305139 243786 139 1530 1 0% 0 0 0
30k_ifelse (click) 5552499 4345506 9261 57795 0 0% 0 0 0
30k_methods (click) 2167411 1653835 5780 19352 0 0% 0 0 0
cfunc_itself (click) 161907 123811 6 40 0 0% 0 0 0
fib (click) 160179 123286 6 29 0 0% 0 0 0
getivar (click) 161907 125797 6 56 0 0% 0 0 0
keyword_args (click) 162547 124319 7 42 0 0% 0 0 0
respond_to (click) 163827 125132 6 55 0 0% 0 0 0
setivar (click) 161843 124321 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.