YJIT Benchmarks

Details for Benchmarks at 2025-01-24 03:43:20 GMT

YJIT metrics from the yjit-bench suite using Ruby 881924f259.

Using the geomean of the headline benchmarks for x86 YJIT 3.5.0dev is
  • 90.7% faster than CRuby 3.5.0dev
  • 5.4% faster than YJIT 3.3.6
On railsbench it is
  • 100.7% faster than CRuby 3.5.0dev
  • 7.4% faster than YJIT 3.3.6
x86_64 runtime: 3 hours, 50 minutes
aarch64 runtime: 3 hours, 17 minutes

Performance on Headline Benchmarks

Select Platform
0.0 0.5 1.0 1.5 2.0 2.5 CRuby 3.3.6 CRuby 3.5.0dev YJIT 3.3.6 YJIT 3.5.0dev activerecord chunky-png erubi-rails hexapdf liquid-c liquid-compile liquid-render lobsters mail psych-load railsbench rubocop ruby-lsp sequel geomean* 1.02 2.37 2.45 1.02 1.81 2.31 1.00 2.31 2.24 1.00 1.81 1.93 1.00 1.50 1.60 1.00 1.42 1.48 1.01 2.60 2.80 0.99 1.67 1.69 0.99 1.51 1.51 0.99 1.47 1.66 1.00 1.87 2.01 0.96 1.96 2.06 1.01 1.97 1.99 0.99 1.51 1.48 1.00 1.81 1.91
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 1.6 1.8 CRuby 3.3.6 CRuby 3.5.0dev YJIT 3.3.6 YJIT 3.5.0dev activerecord chunky-png erubi-rails hexapdf liquid-c liquid-compile liquid-render lobsters mail psych-load railsbench rubocop ruby-lsp sequel geomean* 1.02 1.14 1.04 0.76 0.99 0.77 0.99 1.10 0.99 0.80 1.84 1.06 0.80 1.10 0.92 0.82 1.10 0.90 0.83 1.14 0.98 0.98 1.13 1.14 0.95 1.12 0.99 0.81 1.06 0.86 0.91 1.13 1.07 0.91 1.36 1.34 0.84 1.06 0.83 0.80 1.10 0.90 0.87 1.16 0.98
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
Memory usage of each Ruby implementation relative to the baseline CRuby measurement. Lower is better.

Performance on MicroBenchmarks

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

Memory Usage on MicroBenchmarks

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

Benchmark Memory Usage Details

Select Platform
bench CRuby 3.3.6 mem (MiB) CRuby 3.5.0dev mem (MiB) YJIT 3.3.6 mem (MiB) YJIT 3.5.0dev mem (MiB) Inline Code Outlined Code YJIT Mem overhead
activerecord 63 64 72 65 2 2 1.2%
chunky-png 57 43 56 43 1 1 1.1%
erubi-rails 106 105 117 105 2 2 -0.4%
hexapdf 157 125 288 166 2 2 32.7%
liquid-c 36 28 39 33 1 1 15.4%
liquid-compile 32 26 35 29 1 1 9.9%
liquid-render 34 28 39 34 1 1 18.6%
lobsters 279 272 316 317 8 7 16.3%
mail 52 49 58 51 1 1 3.9%
psych-load 32 26 34 28 1 1 6.6%
railsbench 107 97 121 115 4 3 17.9%
rubocop 91 82 124 122 6 5 47.5%
ruby-lsp 71 60 76 59 1 1 -0.8%
sequel 37 29 40 33 1 1 11.7%
binarytrees 26 21 26 22 1 1 2.6%
blurhash 21 14 22 15 1 1 5.7%
erubi 28 36 30 38 1 1 5.3%
etanni 23 19 24 20 1 1 2.5%
fannkuchredux 20 13 20 13 1 1 5.2%
fluentd 192 284 205 215 1 1 -24.4%
graphql 39 34 41 36 1 1 5.9%
graphql-native 39 35 43 34 1 1 -2.6%
lee 30 27 31 29 1 1 6.9%
matmul 27 21 28 22 1 1 2.5%
nbody 20 13 20 13 1 1 4.2%
nqueens 20 13 21 15 1 1 10.1%
optcarrot 61 48 68 50 1 1 3.9%
protoboeuf 36 31 40 27 1 1 -12.1%
protoboeuf-encode 63 46 69 78 1 1 66.7%
rack 31 22 32 25 1 1 13.1%
ruby-json 20 14 21 14 1 1 4.0%
rubykon 24 17 26 18 1 1 6.1%
sudoku 20 13 21 14 1 1 5.4%
tinygql 26 19 29 22 1 1 15.5%
30k_ifelse 61 110 91 118 6 6 7.5%
30k_methods 49 53 59 56 3 2 5.9%
cfunc_itself 20 13 20 13 1 1 4.1%
fib 20 13 20 13 1 1 4.2%
getivar 20 13 20 13 1 1 4.2%
keyword_args 20 13 20 13 1 1 4.1%
loops-times 22 15 24 21 1 1 38.3%
object-new 20 13 20 13 1 1 4.1%
respond_to 20 13 20 13 1 1 4.5%
ruby-xor 21 14 21 14 1 1 3.7%
setivar 20 13 20 13 1 1 4.6%
setivar_object 20 13 20 13 1 1 4.1%
setivar_young 20 13 20 13 1 1 4.2%
str_concat 46 39 60 40 1 1 1.4%
throw 20 13 20 13 1 1 4.1%

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 CRuby 3.3.6 warmups CRuby 3.3.6 iters CRuby 3.5.0dev warmups CRuby 3.5.0dev iters YJIT 3.3.6 warmups YJIT 3.3.6 iters YJIT 3.5.0dev warmups YJIT 3.5.0dev iters
activerecord 5 83 5 85 50 156 50 163
chunky-png 5 31 5 32 50 15 50 33
erubi-rails 5 16 5 15 50 10 50 10
hexapdf 5 10 5 10 50 10 50 10
liquid-c 5 422 5 423 50 591 50 631
liquid-compile 5 409 5 409 50 538 50 560
liquid-render 5 171 5 172 50 404 50 440
lobsters 5 20 5 20 50 10 50 10
mail 5 195 5 193 50 251 50 251
psych-load 5 10 5 10 50 10 50 10
railsbench 5 10 5 10 50 10 50 10
rubocop 5 156 5 150 50 253 50 265
ruby-lsp 5 153 5 154 50 259 50 263
sequel 5 426 5 423 50 601 50 589
binarytrees 5 84 5 82 50 148 50 140
blurhash 5 82 5 81 50 127 50 145
erubi 5 115 5 151 50 34 50 151
etanni 5 90 5 99 50 54 50 71
fannkuchredux 5 52 5 54 50 99 50 107
fluentd 5 64 5 72 50 25 50 28
graphql 5 84 5 85 50 57 50 56
graphql-native 5 40 5 52 50 10 50 12
lee 5 22 5 23 50 10 50 10
matmul 5 50 5 54 50 85 50 98
nbody 5 248 5 251 50 577 50 704
nqueens 5 120 5 123 50 75 50 563
optcarrot 5 10 5 10 50 10 50 10
protoboeuf 5 174 5 172 50 618 50 715
protoboeuf-encode 5 173 5 176 50 327 50 827
rack 5 569 5 631 50 952 50 1066
ruby-json 5 84 5 83 50 50 50 50
rubykon 5 21 5 22 50 10 50 10
sudoku 5 47 5 49 50 164 50 171
tinygql 5 36 5 37 50 22 50 28
30k_ifelse 5 28 5 28 50 214 50 205
30k_methods 5 39 5 38 50 483 50 476
cfunc_itself 5 346 5 337 50 1147 50 1254
fib 5 127 5 133 50 910 50 932
getivar 5 207 5 317 50 2234 50 2757
keyword_args 5 107 5 104 50 1040 50 1240
loops-times 5 24 5 25 50 48 50 65
object-new 5 323 5 276 50 405 50 306
respond_to 5 134 5 141 50 3256 50 3971
ruby-xor 5 220 5 242 50 801 50 1374
setivar 5 357 5 580 50 3187 50 5895
setivar_object 5 354 5 401 50 697 50 774
setivar_young 5 365 5 411 50 743 50 808
str_concat 5 400 5 451 50 967 50 1210
throw 5 1266 5 1125 50 1780 50 1445

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 Compile Time MS
activerecord (click) 1429740 1161014 209 2204 0 0% 0 0 64.191052
chunky-png (click) 308270 248197 84 1124 1 0% 0 0 33.088143
erubi-rails (click) 1930704 1667410 259 3004 19 0% 0 0 87.999566
hexapdf (click) 1451247 1256167 595 13144 38 0% 0 0 377.754135
liquid-c (click) 473589 402371 114 1743 5 0% 0 0 49.402611
liquid-compile (click) 429245 351417 146 2090 2 0% 0 0 66.719744
liquid-render (click) 607090 489161 131 2309 8 0% 0 0 64.780758
lobsters (click) 8126423 6854849 3207 52545 169 0% 0 0 1794.770698
mail (click) 725361 664625 342 5318 14 0% 0 0 156.323009
psych-load (click) 249841 209521 61 615 3 0% 0 0 19.250521
railsbench (click) 3262654 2870126 1645 16242 52 0% 0 0 470.890631
rubocop (click) 5672264 4874548 2887 50514 110 0% 4 0 1487.439667
ruby-lsp (click) 808480 705906 305 4734 24 0% 0 0 134.528008
sequel (click) 477656 400601 11 94 0 0% 0 0 3.730538
binarytrees (click) 7093 6143 6 52 0 0% 0 0 2.289391
blurhash (click) 50118 50863 27 438 0 0% 0 0 14.184961
erubi (click) 238108 176806 5 97 0 0% 0 0 3.245911
etanni (click) 27173 26329 8 88 0 0% 0 0 2.984532
fannkuchredux (click) 23046 13626 3 249 0 0% 0 0 7.463384
fluentd (click) 364810 287019 7 93 0 0% 0 0 3.209674
graphql (click) 397099 364523 66 676 0 0% 0 0 21.150745
graphql-native (click) 394138 345180 37 255 0 0% 0 0 8.223707
lee (click) 301640 262734 45 750 0 0% 0 0 23.379418
matmul (click) 10657 3512 8 109 0 0% 0 0 3.598771
nbody (click) 13065 17086 6 172 0 0% 0 0 4.460483
nqueens (click) 20163 27348 5 239 0 0% 0 0 7.129184
optcarrot (click) 319096 242804 188 4399 34 0% 0 0 102.239704
protoboeuf (click) 150678 129601 12 1479 0 0% 0 0 42.014232
protoboeuf-encode (click) 221107 212146 14 1220 0 0% 0 0 31.478402
rack (click) 265153 208770 32 385 0 0% 0 0 10.332694
ruby-json (click) 20461 17978 8 181 0 0% 0 0 5.131518
rubykon (click) 133148 127961 137 1480 3 0% 0 0 42.256739
sudoku (click) 45311 40871 7 516 0 0% 0 0 15.582432
tinygql (click) 295219 242195 58 762 5 0% 0 0 21.646277
30k_ifelse (click) 5658804 5284852 9259 51668 0 0% 0 0 1413.075704
30k_methods (click) 2234569 1592883 5778 19351 0 0% 0 0 453.182845
cfunc_itself (click) 5130 4086 4 47 0 0% 0 0 1.341555
fib (click) 2599 2861 3 26 0 0% 0 0 1.044494
getivar (click) 3501 4713 3 51 0 0% 0 0 1.373975
keyword_args (click) 6320 4813 5 49 0 0% 0 0 1.588256
loops-times (click) 6703 7405 5 71 0 0% 0 0 2.398123
object-new (click) 1933 2093 2 22 0 0% 0 0 0.778339
respond_to (click) 5868 6227 4 62 0 0% 0 0 1.754017
ruby-xor (click) 5331 6009 4 64 0 0% 0 0 1.908647
setivar (click) 2652 3389 3 31 0 0% 0 0 1.021068
setivar_object (click) 3181 3537 3 33 0 0% 0 0 1.145777
setivar_young (click) 3891 4259 4 41 0 0% 0 0 1.348888
str_concat (click) 5469 6016 6 62 0 0% 0 0 2.021873
throw (click) 5848 4291 5 46 0 0% 0 0 1.604781

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.