Ruby Benchmarks

Details for Benchmarks at 2025-12-02 00:41:34 UTC

YJIT metrics from the ruby-bench suite using Ruby 2dfb8149d5.

Using the geomean of the headline benchmarks for x86 YJIT 4.0.0dev is
  • 91.5% faster than CRuby 4.0.0dev
  • 1.5% faster than YJIT 3.4.7
On railsbench it is
  • 101.7% faster than CRuby 4.0.0dev
  • 2.9% 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 190 50 216
chunky-png 5 31 5 33 50 33 50 29
erubi-rails 5 15 5 16 50 10 50 10
hexapdf 5 10 5 10 50 10 50 10
liquid-c 5 421 5 398 50 619 50 562
liquid-compile 5 417 5 464 50 546 50 710
liquid-render 5 172 5 162 50 414 50 383
lobsters 5 20 5 20 50 10 50 10
mail 5 195 5 178 50 253 50 202
psych-load 5 10 5 10 50 10 50 10
railsbench 5 10 5 10 50 10 50 10
rubocop 5 153 5 158 50 247 50 251
ruby-lsp 5 143 5 147 50 241 50 238
sequel 5 422 5 436 50 587 50 599
shipit 5 10 5 10 50 10 50 10
addressable-equality 5 27 5 27 50 11 50 10
addressable-getters 5 165 5 166 50 185 50 188
addressable-join 5 73 5 61 50 66 50 45
addressable-merge 5 160 5 155 50 222 50 211
addressable-new 5 356 5 342 50 525 50 491
addressable-normalize 5 53 5 52 50 59 50 54
addressable-parse 5 103 5 102 50 104 50 103
addressable-setters 5 185 5 181 50 229 50 223
addressable-to-s 5 164 5 166 50 184 50 187
binarytrees 5 82 5 84 50 135 50 132
blurhash 5 83 5 87 50 143 50 145
erubi 5 128 5 140 50 119 50 140
etanni 5 97 5 70 50 72 50 36
fannkuchredux 5 54 5 57 50 102 50 100
fluentd 5 59 5 59 50 29 50 31
graphql 5 372 5 462 50 574 50 914
graphql-native 5 59 5 80 50 23 50 64
knucleotide 5 163 5 160 50 118 50 114
lee 5 23 5 23 50 10 50 10
matmul 5 51 5 52 50 94 50 90
nbody 5 247 5 257 50 676 50 666
nqueens 5 116 5 127 50 556 50 569
optcarrot 5 10 5 10 50 10 50 10
protoboeuf 5 175 5 190 50 706 50 753
protoboeuf-encode 5 197 5 210 50 825 50 792
rack 5 436 5 441 50 720 50 700
ruby-json 5 82 5 99 50 47 50 69
rubyboy 5 10 5 10 50 10 50 10
rubykon 5 21 5 21 50 10 50 10
sudoku 5 48 5 48 50 156 50 155
tinygql 5 42 5 43 50 40 50 47
30k_ifelse 5 28 5 28 50 185 50 183
30k_methods 5 38 5 40 50 455 50 452
attr_accessor 5 157 5 216 50 1834 50 1945
cfunc_itself 5 349 5 349 50 1254 50 1259
fib 5 124 5 143 50 939 50 939
getivar 5 217 5 339 50 2316 50 2440
getivar-module 5 104 5 141 50 90 50 270
keyword_args 5 100 5 108 50 1239 50 1243
loops-times 5 23 5 26 50 64 50 55
object-new 5 268 5 320 50 298 50 480
respond_to 5 139 5 140 50 3888 50 3897
ruby-xor 5 237 5 220 50 1314 50 1291
send_bmethod 5 116 5 122 50 5539 50 5544
send_cfunc_block 5 106 5 107 50 353 50 340
send_rubyfunc_block 5 251 5 253 50 6925 50 6925
setivar 5 360 5 396 50 4924 50 4977
setivar_object 5 341 5 335 50 749 50 602
setivar_young 5 341 5 337 50 797 50 635
str_concat 5 391 5 462 50 1200 50 1193
structaref 5 157 5 214 50 1813 50 1918
structaset 5 202 5 232 50 396 50 345
throw 5 1088 5 1194 50 1413 50 1412

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) 1544856 1310489 205 2579 0 0% 0 0 78.217063
chunky-png (click) 321395 280473 79 1373 1 0% 0 0 38.585664
erubi-rails (click) 1381808 1161291 267 3682 22 0% 0 0 98.24843
hexapdf (click) 1524519 1348345 594 15666 44 0% 0 0 435.335754
liquid-c (click) 556566 512614 114 2228 5 0% 0 0 60.131932
liquid-compile (click) 480546 408657 146 2730 2 0% 0 0 79.035628
liquid-render (click) 663173 571030 131 2946 8 0% 0 0 79.259843
lobsters (click) 8524423 7084369 3100 62390 118 0% 0 0 2086.732258
mail (click) 866177 836443 342 7710 40 0% 0 0 213.600385
psych-load (click) 284764 247190 61 828 2 0% 0 0 23.840017
railsbench (click) 3359251 2928874 1605 19605 47 0% 0 0 546.803535
rubocop (click) 5762185 4975215 3001 56860 127 0% 6 0 1657.3719
ruby-lsp (click) 959175 806042 342 6701 44 0% 1 0 179.783018
sequel (click) 503504 432296 11 119 0 0% 0 0 4.125013
shipit (click) 7738375 6637557 3345 53426 181 0% 1 0 1833.975938
addressable-equality (click) 318826 271045 44 1381 1 0% 0 0 34.327738
addressable-getters (click) 279176 221992 26 863 0 0% 0 0 20.806439
addressable-join (click) 284922 279962 24 941 0 0% 0 0 23.362617
addressable-merge (click) 284948 266131 27 896 0 0% 0 0 21.999087
addressable-new (click) 261247 249066 21 591 0 0% 0 0 14.669612
addressable-normalize (click) 314908 282990 43 1330 1 0% 0 0 32.633494
addressable-parse (click) 282387 248974 26 882 0 0% 0 0 21.705362
addressable-setters (click) 260018 216797 20 582 0 0% 0 0 14.312416
addressable-to-s (click) 279122 237655 26 849 0 0% 0 0 20.640275
binarytrees (click) 7463 7718 6 76 0 0% 0 0 2.840266
blurhash (click) 52292 43311 27 605 0 0% 0 0 17.966837
erubi (click) 248592 191328 6 134 0 0% 0 0 3.968164
etanni (click) 32930 35718 8 114 0 0% 0 0 3.588368
fannkuchredux (click) 24735 32812 3 401 0 0% 0 0 11.075881
fluentd (click) 490819 475148 7 115 0 0% 0 0 3.717023
graphql (click) 410740 378589 73 1921 19 0% 0 0 54.077005
graphql-native (click) 355129 295952 39 532 0 0% 0 0 13.799601
knucleotide (click) 9997 11103 7 113 0 0% 0 0 5.868713
lee (click) 318578 305699 49 1097 0 0% 0 0 31.549924
matmul (click) 11103 4709 8 136 0 0% 0 0 4.162186
nbody (click) 14448 21176 6 251 0 0% 0 0 6.077347
nqueens (click) 22633 28819 5 389 0 0% 0 0 10.330434
optcarrot (click) 325946 290644 188 4740 34 0% 0 0 110.960251
protoboeuf (click) 170129 185909 12 2837 0 0% 0 0 72.320694
protoboeuf-encode (click) 243065 291927 14 1816 0 0% 0 0 44.850706
rack (click) 281123 232808 35 580 0 0% 0 0 15.379654
ruby-json (click) 19868 17928 8 206 0 0% 0 0 5.69333
rubyboy (click) 704983 614248 154 6864 42 0% 0 0 167.364987
rubykon (click) 146441 162602 137 2076 3 0% 0 0 56.278426
sudoku (click) 52278 66593 7 878 0 0% 0 0 23.577897
tinygql (click) 301218 264178 59 1031 5 0% 0 0 27.097912
30k_ifelse (click) 6222887 5052688 9260 75477 0 0% 0 0 1920.062739
30k_methods (click) 2278087 1643066 5780 19370 0 0% 0 0 489.783283
attr_accessor (click) 4349 7928 3 79 0 0% 0 0 2.102997
cfunc_itself (click) 5127 4155 4 53 0 0% 0 0 1.525325
fib (click) 2659 2995 3 30 0 0% 0 0 1.156575
getivar (click) 3789 6778 3 79 0 0% 0 0 1.929179
getivar-module (click) 6752 11953 4 142 0 0% 0 0 3.315666
keyword_args (click) 6332 4965 5 56 0 0% 0 0 1.826903
loops-times (click) 7093 8387 5 100 0 0% 0 0 2.882877
object-new (click) 2406 2818 2 36 0 0% 0 0 1.108237
respond_to (click) 6451 6819 4 80 0 0% 0 0 2.188038
ruby-xor (click) 6037 9212 4 105 0 0% 0 0 2.810264
send_bmethod (click) 5238 4968 6 71 0 0% 0 0 1.740117
send_cfunc_block (click) 14669 12471 5 195 0 0% 0 0 4.274833
send_rubyfunc_block (click) 3904 4074 5 69 0 0% 0 0 1.488112
setivar (click) 2783 3726 3 46 0 0% 0 0 1.288967
setivar_object (click) 3402 3956 3 49 0 0% 0 0 1.437589
setivar_young (click) 4300 4867 4 63 0 0% 0 0 1.71646
str_concat (click) 5799 6969 6 82 0 0% 0 0 2.398386
structaref (click) 4407 9095 3 88 0 0% 0 0 2.331557
structaset (click) 3926 5614 3 70 0 0% 0 0 1.766728
throw (click) 5953 4624 5 53 0 0% 0 0 1.812177

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.