YJIT Benchmarks

Details for Benchmarks at 2021-10-09 19:09:17 GMT

YJIT metrics from the yjit-bench suite

Overall YJIT is 29.1% faster than interpreted CRuby!
On Railsbench specifically, YJIT is 23.6% faster than CRuby!

Performance on Headline Benchmarks

0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 No JIT MJIT3.0 YJIT activerecord hexapdf liquid-render mail psych-load railsbench
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 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.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 No JIT MJIT3.0 YJIT binarytrees fannkuchredux jekyll lee nbody optcarrot
Speed of each Ruby implementation relative to the baseline CRuby measurement. Higher is better.

Memory Usage on Other Benchmarks

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 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

0.0 2.0 4.0 6.0 8.0 10.0 12.0 CRuby 3.1.0dev MJIT3.0 YJIT 3.1.0dev 30k_ifelse 30k_methods cfunc_itself fib getivar keyword_args respond_to setivar geomean*
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) YJIT 3.1.0dev mem (MiB) Inline Code Outlined Code YJIT Mem overhead
activerecord 61 64 322 2 1 426.6%
hexapdf 369 316 635 1 1 72.0%
liquid-render 30 32 289 1 1 844.2%
mail 48 50 307 1 1 534.7%
psych-load 31 36 284 1 1 807.9%
railsbench 107 184 379 3 2 254.5%
binarytrees 28 31 284 1 1 888.6%
fannkuchredux 23 22 279 1 1 1100.5%
jekyll 854 846 1124 2 2 31.5%
lee 28 29 286 1 1 898.1%
nbody 23 22 279 1 1 1115.5%
optcarrot 97 107 356 1 1 265.1%
30k_ifelse 64 63 350 6 5 442.0%
30k_methods 54 55 317 3 2 488.6%
cfunc_itself 22 21 279 1 1 1121.9%
fib 22 21 279 1 1 1127.4%
getivar 23 21 279 1 1 1112.2%
keyword_args 22 22 279 1 1 1121.2%
respond_to 22 22 279 1 1 1124.5%
setivar 23 21 279 1 1 1110.5%

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 YJIT warmups YJIT iters
activerecord 10 126 10 120 10 177
hexapdf 10 10 10 10 10 10
liquid-render 10 103 10 113 10 149
mail 10 119 10 125 10 133
psych-load 10 10 10 10 10 10
railsbench 10 10 10 10 10 10
binarytrees 10 44 10 68 10 58
fannkuchredux 10 10 10 10 10 10
jekyll 10 10 10 10 10 10
lee 10 10 10 13 10 16
nbody 10 172 10 331 10 258
optcarrot 10 10 10 10 10 10
30k_ifelse 10 10 10 10 10 50
30k_methods 10 10 10 10 10 17
cfunc_itself 10 210 10 337 10 507
fib 10 93 10 308 10 375
getivar 10 212 10 211 10 529
keyword_args 10 76 10 95 10 422
respond_to 10 77 10 90 10 109
setivar 10 282 10 263 10 518

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) 1111322 865842 185 1153 0 0% 0 0 0
hexapdf (click) 975489 816698 602 7876 677 8% 0 0 320
liquid-render (click) 459412 375605 143 1288 94 7% 0 0 1
mail (click) 970074 749528 337 4987 131 2% 0 0 39
psych-load (click) 185450 149557 56 409 1 0% 0 0 0
railsbench (click) 2564273 1998043 1293 9565 262 2% 0 0 26
binarytrees (click) 113533 89826 9 49 0 0% 0 0 0
fannkuchredux (click) 129021 103057 6 203 0 0% 0 0 0
jekyll (click) 1962842 1631815 337 3747 174 4% 0 0 0
lee (click) 234922 181419 85 1091 114 10% 1 0 13
nbody (click) 122941 97556 8 149 0 0% 0 0 0
optcarrot (click) 650045 584808 286 5576 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) 111933 88265 6 40 0 0% 0 0 0
fib (click) 110461 87838 6 29 0 0% 0 0 0
getivar (click) 112573 91057 6 56 0 0% 0 0 0
keyword_args (click) 112829 89021 7 42 0 0% 0 0 0
respond_to (click) 114109 89941 6 55 0 0% 0 0 0
setivar (click) 112573 89366 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.