Ruby Benchmarks

Details for Benchmarks at 2025-12-06 00:39:11 UTC

YJIT metrics from the ruby-bench suite using Ruby 8f9838476d.

Using the geomean of the headline benchmarks for x86 YJIT 4.0.0dev is
  • 89.1% faster than CRuby 4.0.0dev
  • 1.3% slower than YJIT 3.4.7
On railsbench it is
  • 102.4% faster than CRuby 4.0.0dev
  • 5.4% faster than YJIT 3.4.7
x86_64 runtime: 8 hours, 12 minutes
aarch64 runtime: 7 hours, 4 minutes

Performance on Headline Benchmarks

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

Memory Usage on Headline Benchmarks

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

Performance on Other Benchmarks

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

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

Number of Iterations and Warmups Tested

bench CRuby 3.4.7 warmups CRuby 3.4.7 iters CRuby 4.0.0dev warmups CRuby 4.0.0dev iters YJIT 3.4.7 warmups YJIT 3.4.7 iters YJIT 4.0.0dev warmups YJIT 4.0.0dev iters
activerecord 5 84 5 87 50 194 50 222
chunky-png 5 31 5 33 50 33 50 30
erubi-rails 5 15 5 15 50 10 50 10
hexapdf 5 10 5 10 50 10 50 10
liquid-c 5 424 5 389 50 622 50 575
liquid-compile 5 416 5 473 50 585 50 717
liquid-render 5 173 5 168 50 438 50 371
lobsters 5 20 5 20 50 10 50 10
mail 5 195 5 151 50 253 50 153
psych-load 5 10 5 10 50 10 50 10
railsbench 5 10 5 10 50 10 50 10
rubocop 5 154 5 158 50 247 50 249
ruby-lsp 5 142 5 147 50 246 50 246
sequel 5 425 5 440 50 584 50 601
shipit 5 10 5 10 50 10 50 10
addressable-equality 5 27 5 26 50 11 50 10
addressable-getters 5 164 5 165 50 185 50 187
addressable-join 5 73 5 52 50 65 50 40
addressable-merge 5 160 5 153 50 222 50 208
addressable-new 5 353 5 334 50 520 50 493
addressable-normalize 5 53 5 53 50 59 50 55
addressable-parse 5 103 5 102 50 104 50 101
addressable-setters 5 183 5 174 50 230 50 211
addressable-to-s 5 162 5 164 50 182 50 184
binarytrees 5 82 5 83 50 136 50 131
blurhash 5 83 5 87 50 143 50 144
erubi 5 132 5 144 50 117 50 134
etanni 5 98 5 69 50 71 50 34
fannkuchredux 5 54 5 57 50 102 50 96
fluentd 5 56 5 59 50 20 50 31
graphql 5 369 5 460 50 573 50 905
graphql-native 5 59 5 80 50 22 50 63
knucleotide 5 163 5 163 50 118 50 117
lee 5 23 5 23 50 10 50 10
matmul 5 51 5 52 50 94 50 89
nbody 5 246 5 263 50 676 50 705
nqueens 5 116 5 125 50 556 50 565
optcarrot 5 10 5 10 50 10 50 10
protoboeuf 5 175 5 186 50 706 50 772
protoboeuf-encode 5 197 5 212 50 835 50 813
rack 5 442 5 444 50 711 50 701
ruby-json 5 82 5 101 50 47 50 70
rubyboy 5 10 5 10 50 10 50 10
rubykon 5 21 5 22 50 10 50 10
sudoku 5 48 5 48 50 156 50 155
tinygql 5 42 5 44 50 35 50 49
30k_ifelse 5 28 5 28 50 183 50 183
30k_methods 5 38 5 40 50 458 50 454
attr_accessor 5 157 5 204 50 1836 50 1932
cfunc_itself 5 347 5 354 50 1255 50 1259
fib 5 124 5 143 50 940 50 939
getivar 5 214 5 325 50 2310 50 2431
getivar-module 5 104 5 142 50 90 50 270
keyword_args 5 100 5 110 50 1240 50 1243
loops-times 5 23 5 26 50 64 50 55
object-new 5 269 5 318 50 298 50 499
respond_to 5 139 5 131 50 3889 50 3899
ruby-xor 5 236 5 259 50 1314 50 1292
send_bmethod 5 117 5 125 50 5538 50 5544
send_cfunc_block 5 106 5 102 50 353 50 341
send_rubyfunc_block 5 249 5 259 50 6923 50 6929
setivar 5 360 5 395 50 4924 50 4976
setivar_object 5 341 5 335 50 752 50 610
setivar_young 5 341 5 338 50 799 50 638
str_concat 5 390 5 454 50 1202 50 1128
structaref 5 156 5 213 50 1810 50 1901
structaset 5 200 5 227 50 396 50 352
throw 5 1087 5 1167 50 1414 50 1436

Different Ruby configurations want different amounts of warmup. With no JIT, CRuby needs hardly any. YJIT warms up fairly quickly, while some JITs may start slower as they do more advanced compilation.

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) 1549650 1290318 205 2579 0 0% 0 0 72.804167
chunky-png (click) 321439 296926 79 1373 1 0% 0 0 39.150215
erubi-rails (click) 1384959 1182685 267 3721 22 0% 0 0 100.633604
hexapdf (click) 1525433 1357688 593 15682 44 0% 0 0 440.20987
liquid-c (click) 556638 488145 114 2228 5 0% 0 0 60.523961
liquid-compile (click) 479017 431479 146 2708 2 0% 0 0 80.457596
liquid-render (click) 664433 621524 131 2946 8 0% 0 0 79.616541
lobsters (click) 8512290 7056270 3100 62272 118 0% 0 0 2094.311973
mail (click) 865542 819419 342 7700 40 0% 0 0 212.955928
psych-load (click) 288657 258381 61 828 2 0% 0 0 23.590909
railsbench (click) 3360795 2856607 1605 19601 47 0% 0 0 549.443097
rubocop (click) 5762015 4934542 3001 56867 127 0% 6 0 1659.853753
ruby-lsp (click) 959227 838971 342 6701 44 0% 1 0 181.406738
sequel (click) 503541 448699 11 119 0 0% 0 0 4.118239
shipit (click) 7606959 6341828 3262 51894 180 0% 0 0 1707.313744
addressable-equality (click) 319208 271419 44 1381 1 0% 0 0 34.292194
addressable-getters (click) 281680 249580 26 905 0 0% 0 0 21.819406
addressable-join (click) 284966 214475 24 941 0 0% 0 0 23.486847
addressable-merge (click) 284992 233412 27 896 0 0% 0 0 22.218262
addressable-new (click) 260353 198702 21 569 0 0% 0 0 14.275018
addressable-normalize (click) 314439 249938 43 1330 1 0% 0 0 32.661624
addressable-parse (click) 282270 216044 26 880 0 0% 0 0 21.727896
addressable-setters (click) 260018 225009 20 582 0 0% 0 0 14.481189
addressable-to-s (click) 279166 213128 26 849 0 0% 0 0 20.736201
binarytrees (click) 7463 7718 6 76 0 0% 0 0 2.873863
blurhash (click) 52292 43311 27 605 0 0% 0 0 18.132328
erubi (click) 248592 240500 6 134 0 0% 0 0 4.033475
etanni (click) 32930 35718 8 114 0 0% 0 0 3.583115
fannkuchredux (click) 24735 32812 3 401 0 0% 0 0 11.02671
fluentd (click) 489547 441321 7 115 0 0% 0 0 3.817604
graphql (click) 410446 370106 73 1921 19 0% 0 0 52.975049
graphql-native (click) 355470 312652 39 532 0 0% 0 0 13.700477
knucleotide (click) 9997 11103 7 113 0 0% 0 0 5.76513
lee (click) 318533 264710 49 1097 0 0% 0 0 31.439963
matmul (click) 11103 4709 8 136 0 0% 0 0 4.15323
nbody (click) 14448 21176 6 251 0 0% 0 0 6.17872
nqueens (click) 22633 28819 5 389 0 0% 0 0 10.401412
optcarrot (click) 325946 290644 188 4740 34 0% 0 0 110.753073
protoboeuf (click) 169711 234423 12 2832 0 0% 0 0 72.482722
protoboeuf-encode (click) 243065 291927 14 1816 0 0% 0 0 44.816685
rack (click) 281510 266002 35 580 0 0% 0 0 15.877291
ruby-json (click) 19868 17928 8 206 0 0% 0 0 5.754721
rubyboy (click) 703779 572845 154 6862 42 0% 0 0 166.820145
rubykon (click) 146229 153926 137 2070 3 0% 0 0 56.614832
sudoku (click) 52278 66593 7 878 0 0% 0 0 23.640053
tinygql (click) 301840 281164 59 1037 5 0% 0 0 27.076873
30k_ifelse (click) 6222887 5052688 9260 75477 0 0% 0 0 1925.674598
30k_methods (click) 2278087 1643066 5780 19370 0 0% 0 0 487.993865
attr_accessor (click) 4349 7928 3 79 0 0% 0 0 2.10607
cfunc_itself (click) 5127 4155 4 53 0 0% 0 0 1.521713
fib (click) 2659 2995 3 30 0 0% 0 0 1.13782
getivar (click) 3789 6778 3 79 0 0% 0 0 1.961325
getivar-module (click) 6752 11953 4 142 0 0% 0 0 3.334649
keyword_args (click) 6332 4965 5 56 0 0% 0 0 1.828915
loops-times (click) 7093 8387 5 100 0 0% 0 0 2.874317
object-new (click) 2406 2818 2 36 0 0% 0 0 1.165288
respond_to (click) 6451 6819 4 80 0 0% 0 0 2.088805
ruby-xor (click) 6037 9212 4 105 0 0% 0 0 2.840114
send_bmethod (click) 5238 4968 6 71 0 0% 0 0 1.750565
send_cfunc_block (click) 14669 12471 5 195 0 0% 0 0 4.259824
send_rubyfunc_block (click) 3904 4074 5 69 0 0% 0 0 1.48523
setivar (click) 2783 3726 3 46 0 0% 0 0 1.270102
setivar_object (click) 3402 3956 3 49 0 0% 0 0 1.447187
setivar_young (click) 4300 4867 4 63 0 0% 0 0 1.754701
str_concat (click) 5799 6969 6 82 0 0% 0 0 2.435519
structaref (click) 4407 9095 3 88 0 0% 0 0 2.341089
structaset (click) 3926 5614 3 70 0 0% 0 0 1.760105
throw (click) 5953 4624 5 53 0 0% 0 0 1.792973

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.