Ruby Benchmarks

Details for Benchmarks at 2025-12-20 00:40:08 UTC

YJIT metrics from the ruby-bench suite using Ruby 8274c5e142.

Using the geomean of the headline benchmarks for x86 YJIT 4.0.0dev is
  • 95.5% faster than CRuby 4.0.0dev
  • 4.6% faster than YJIT 3.4.7
On railsbench it is
  • 113.4% faster than CRuby 4.0.0dev
  • 9.1% faster than YJIT 3.4.7
x86_64 runtime: 8 hours, 16 minutes
aarch64 runtime: 7 hours, 9 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 91 5 98 50 197 50 235
chunky-png 5 31 5 33 50 32 50 29
erubi-rails 5 15 5 15 50 10 50 10
hexapdf 5 10 5 10 50 10 50 10
liquid-c 5 421 5 425 50 627 50 629
liquid-compile 5 417 5 473 50 581 50 716
liquid-render 5 172 5 171 50 436 50 441
lobsters 5 19 5 20 50 10 50 10
mail 5 195 5 191 50 254 50 255
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 246
ruby-lsp 5 146 5 147 50 251 50 245
sequel 5 428 5 433 50 604 50 604
shipit 5 10 5 10 50 10 50 10
addressable-equality 5 27 5 26 50 11 50 10
addressable-getters 5 164 5 166 50 183 50 193
addressable-join 5 72 5 74 50 65 50 70
addressable-merge 5 161 5 155 50 222 50 221
addressable-new 5 355 5 351 50 520 50 523
addressable-normalize 5 54 5 52 50 59 50 57
addressable-parse 5 104 5 103 50 104 50 106
addressable-setters 5 185 5 180 50 229 50 227
addressable-to-s 5 163 5 167 50 183 50 189
binarytrees 5 82 5 84 50 136 50 136
blurhash 5 83 5 87 50 143 50 145
erubi 5 138 5 140 50 136 50 141
etanni 5 98 5 68 50 72 50 33
fannkuchredux 5 55 5 57 50 100 50 104
fluentd 5 56 5 62 50 20 50 31
graphql 5 371 5 474 50 530 50 932
graphql-native 5 59 5 85 50 23 50 66
knucleotide 5 164 5 159 50 118 50 113
lee 5 23 5 23 50 10 50 10
matmul 5 51 5 50 50 94 50 96
nbody 5 247 5 258 50 677 50 704
nqueens 5 116 5 128 50 556 50 591
optcarrot 5 10 5 10 50 10 50 10
protoboeuf 5 176 5 180 50 707 50 711
protoboeuf-encode 5 197 5 196 50 828 50 782
rack 5 443 5 454 50 710 50 696
ruby-json 5 82 5 96 50 46 50 66
rubyboy 5 10 5 10 50 10 50 10
rubykon 5 21 5 21 50 10 50 10
sudoku 5 48 5 49 50 156 50 161
tinygql 5 41 5 43 50 36 50 47
30k_ifelse 5 28 5 28 50 185 50 181
30k_methods 5 38 5 40 50 455 50 453
attr_accessor 5 157 5 195 50 1837 50 1918
cfunc_itself 5 347 5 346 50 1255 50 1259
fib 5 123 5 141 50 939 50 939
getivar 5 217 5 309 50 2315 50 2418
getivar-module 5 104 5 136 50 90 50 267
keyword_args 5 100 5 104 50 1240 50 1243
loops-times 5 23 5 26 50 64 50 61
object-new 5 268 5 360 50 298 50 664
respond_to 5 139 5 137 50 3889 50 3904
ruby-xor 5 237 5 252 50 1314 50 1291
send_bmethod 5 116 5 121 50 5538 50 4527
send_cfunc_block 5 105 5 106 50 353 50 344
send_rubyfunc_block 5 250 5 253 50 6922 50 6930
setivar 5 360 5 464 50 4927 50 5036
setivar_object 5 337 5 333 50 714 50 618
setivar_young 5 341 5 334 50 799 50 639
str_concat 5 394 5 428 50 1201 50 1126
structaref 5 156 5 187 50 1812 50 1867
structaset 5 204 5 263 50 396 50 513
throw 5 1090 5 1287 50 1422 50 1555

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) 1543279 1330040 203 2648 0 0% 0 0 75.337659
chunky-png (click) 320243 270941 79 1373 1 0% 0 0 38.762062
erubi-rails (click) 1370541 1271285 269 3666 22 0% 0 0 97.991342
hexapdf (click) 1523945 1339455 593 15675 44 0% 0 0 437.744701
liquid-c (click) 555366 454166 114 2228 5 0% 0 0 59.399478
liquid-compile (click) 477093 412851 146 2693 2 0% 0 0 77.455733
liquid-render (click) 662564 570290 131 2946 8 0% 0 0 79.324443
lobsters (click) 8664759 7299708 3125 63945 117 0% 0 0 2112.681161
mail (click) 866445 852734 345 7721 40 0% 0 0 214.617942
psych-load (click) 286954 256597 61 828 2 0% 0 0 23.990165
railsbench (click) 3347199 2974645 1591 19724 97 0% 0 0 552.790087
rubocop (click) 5761347 4932366 3002 56861 127 0% 6 0 1658.105993
ruby-lsp (click) 959795 864110 342 6701 44 0% 1 0 180.231657
sequel (click) 501636 405598 11 119 0 0% 0 0 3.845183
shipit (click) 7527785 6390091 3281 52026 182 0% 0 0 1730.499368
addressable-equality (click) 318843 237848 44 1381 1 0% 0 0 34.208829
addressable-getters (click) 277950 253379 26 863 0 0% 0 0 21.080268
addressable-join (click) 283807 245814 24 941 0 0% 0 0 23.83505
addressable-merge (click) 284556 240801 27 896 0 0% 0 0 22.049169
addressable-new (click) 260636 231534 21 569 0 0% 0 0 14.285381
addressable-normalize (click) 314251 241077 43 1328 1 0% 0 0 32.724467
addressable-parse (click) 281311 263978 26 882 0 0% 0 0 21.742843
addressable-setters (click) 259582 191438 20 582 0 0% 0 0 14.676924
addressable-to-s (click) 278137 236409 26 849 0 0% 0 0 20.733217
binarytrees (click) 7463 7718 6 76 0 0% 0 0 2.933708
blurhash (click) 52292 43311 27 605 0 0% 0 0 17.867561
erubi (click) 246913 214209 6 134 0 0% 0 0 3.993468
etanni (click) 33287 36246 8 113 0 0% 0 0 3.514536
fannkuchredux (click) 24735 32812 3 401 0 0% 0 0 10.926089
fluentd (click) 483751 424619 7 115 0 0% 0 0 3.738055
graphql (click) 409600 336249 73 1921 19 0% 0 0 54.470596
graphql-native (click) 354795 270680 39 532 0 0% 0 0 13.933791
knucleotide (click) 9997 11103 7 113 0 0% 0 0 6.327324
lee (click) 317502 287975 49 1097 0 0% 0 0 31.737188
matmul (click) 11103 4709 8 136 0 0% 0 0 4.278676
nbody (click) 14448 21176 6 251 0 0% 0 0 6.143753
nqueens (click) 22633 28819 5 389 0 0% 0 0 10.186422
optcarrot (click) 325946 290644 188 4740 34 0% 0 0 111.345907
protoboeuf (click) 169555 177006 12 2829 0 0% 0 0 72.265893
protoboeuf-encode (click) 242967 283659 14 1815 0 0% 0 0 44.467208
rack (click) 284189 262482 35 654 0 0% 0 0 17.193454
ruby-json (click) 19868 17928 8 206 0 0% 0 0 5.634083
rubyboy (click) 703100 654107 154 6862 42 0% 0 0 166.874437
rubykon (click) 146869 163015 137 2080 3 0% 0 0 56.562957
sudoku (click) 51704 65882 7 870 0 0% 0 0 23.062064
tinygql (click) 299532 262325 59 1025 5 0% 0 0 27.023346
30k_ifelse (click) 6222887 5052688 9260 75477 0 0% 0 0 1925.571533
30k_methods (click) 2278087 1643066 5780 19370 0 0% 0 0 491.993242
attr_accessor (click) 4349 7928 3 79 0 0% 0 0 2.111958
cfunc_itself (click) 5127 4155 4 53 0 0% 0 0 1.542932
fib (click) 2659 2995 3 30 0 0% 0 0 1.159843
getivar (click) 3789 6778 3 79 0 0% 0 0 1.96616
getivar-module (click) 6752 11953 4 142 0 0% 0 0 3.342178
keyword_args (click) 6332 4965 5 56 0 0% 0 0 1.827405
loops-times (click) 7093 8387 5 100 0 0% 0 0 2.925678
object-new (click) 2406 2818 2 36 0 0% 0 0 1.07326
respond_to (click) 6451 6819 4 80 0 0% 0 0 2.273539
ruby-xor (click) 6037 9212 4 105 0 0% 0 0 2.852477
send_bmethod (click) 5508 5328 6 71 0 0% 0 0 1.850587
send_cfunc_block (click) 14429 12201 5 192 0 0% 0 0 4.20102
send_rubyfunc_block (click) 3904 4074 5 69 0 0% 0 0 1.486229
setivar (click) 2783 3726 3 46 0 0% 0 0 1.307491
setivar_object (click) 3402 3956 3 49 0 0% 0 0 1.461879
setivar_young (click) 4300 4867 4 63 0 0% 0 0 1.749608
str_concat (click) 5799 6969 6 82 0 0% 0 0 2.444395
structaref (click) 4407 9095 3 88 0 0% 0 0 2.374924
structaset (click) 3926 5614 3 70 0 0% 0 0 1.732519
throw (click) 5953 4624 5 53 0 0% 0 0 1.847282

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.