Ruby Benchmarks

Details for Benchmarks at 2025-12-15 00:44:36 UTC

YJIT metrics from the ruby-bench suite using Ruby e7cf07ba3e.

Using the geomean of the headline benchmarks for x86 YJIT 4.0.0dev is
  • 95.1% faster than CRuby 4.0.0dev
  • 4.2% faster than YJIT 3.4.7
On railsbench it is
  • 112.1% faster than CRuby 4.0.0dev
  • 9.5% faster than YJIT 3.4.7
x86_64 runtime: 8 hours, 16 minutes
aarch64 runtime: 7 hours, 11 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 90 5 97 50 191 50 234
chunky-png 5 31 5 32 50 33 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 427 50 628 50 621
liquid-compile 5 420 5 464 50 582 50 685
liquid-render 5 171 5 176 50 431 50 423
lobsters 5 20 5 20 50 10 50 10
mail 5 195 5 186 50 252 50 249
psych-load 5 10 5 10 50 10 50 10
railsbench 5 10 5 10 50 10 50 10
rubocop 5 154 5 160 50 247 50 252
ruby-lsp 5 145 5 147 50 236 50 243
sequel 5 420 5 426 50 586 50 594
shipit 5 10 5 10 50 10 50 10
addressable-equality 5 27 5 27 50 11 50 10
addressable-getters 5 164 5 167 50 183 50 188
addressable-join 5 73 5 75 50 66 50 64
addressable-merge 5 161 5 155 50 223 50 210
addressable-new 5 352 5 345 50 523 50 495
addressable-normalize 5 53 5 54 50 59 50 54
addressable-parse 5 104 5 103 50 103 50 102
addressable-setters 5 186 5 178 50 231 50 216
addressable-to-s 5 164 5 165 50 183 50 185
binarytrees 5 82 5 83 50 136 50 134
blurhash 5 83 5 86 50 143 50 144
erubi 5 139 5 145 50 139 50 146
etanni 5 98 5 68 50 70 50 33
fannkuchredux 5 55 5 57 50 102 50 98
fluentd 5 56 5 61 50 20 50 29
graphql 5 372 5 472 50 570 50 928
graphql-native 5 59 5 83 50 23 50 63
knucleotide 5 163 5 153 50 118 50 107
lee 5 23 5 23 50 10 50 10
matmul 5 51 5 55 50 94 50 91
nbody 5 247 5 284 50 677 50 704
nqueens 5 116 5 120 50 556 50 557
optcarrot 5 10 5 10 50 10 50 10
protoboeuf 5 176 5 179 50 706 50 664
protoboeuf-encode 5 195 5 206 50 834 50 788
rack 5 439 5 445 50 706 50 674
ruby-json 5 84 5 96 50 47 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 145
tinygql 5 41 5 43 50 40 50 47
30k_ifelse 5 28 5 28 50 185 50 181
30k_methods 5 38 5 40 50 456 50 447
attr_accessor 5 157 5 191 50 1836 50 1910
cfunc_itself 5 348 5 365 50 1255 50 1259
fib 5 124 5 142 50 939 50 940
getivar 5 218 5 312 50 2316 50 2420
getivar-module 5 104 5 136 50 90 50 267
keyword_args 5 99 5 110 50 1240 50 1242
loops-times 5 23 5 25 50 64 50 55
object-new 5 268 5 352 50 297 50 668
respond_to 5 139 5 139 50 3891 50 3899
ruby-xor 5 231 5 243 50 1314 50 1294
send_bmethod 5 116 5 126 50 5538 50 5543
send_cfunc_block 5 106 5 107 50 353 50 344
send_rubyfunc_block 5 250 5 252 50 6922 50 6932
setivar 5 360 5 394 50 4927 50 4973
setivar_object 5 341 5 356 50 754 50 586
setivar_young 5 342 5 357 50 796 50 618
str_concat 5 392 5 456 50 1201 50 1112
structaref 5 156 5 199 50 1811 50 1903
structaset 5 203 5 232 50 398 50 356
throw 5 1090 5 1220 50 1415 50 1601

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) 1544844 1281370 203 2641 0 0% 0 0 75.216809
chunky-png (click) 320762 312026 79 1373 1 0% 0 0 39.150944
erubi-rails (click) 1370874 1188512 268 3662 22 0% 0 0 98.113724
hexapdf (click) 1526885 1341008 594 15680 44 0% 0 0 438.530497
liquid-c (click) 556925 438838 114 2228 5 0% 0 0 59.891192
liquid-compile (click) 469971 412181 146 2750 2 0% 0 0 80.732759
liquid-render (click) 663314 578833 131 2946 8 0% 0 0 78.7079
lobsters (click) 8663049 7373861 3114 63956 117 0% 0 0 2116.980567
mail (click) 864808 850719 342 7700 40 0% 0 0 213.684599
psych-load (click) 287997 248905 61 828 2 0% 0 0 23.786476
railsbench (click) 3339004 2882917 1590 19708 97 0% 0 0 553.054109
rubocop (click) 5760256 5029976 3002 56856 127 0% 6 0 1664.205786
ruby-lsp (click) 958326 812779 342 6701 44 0% 1 0 179.575234
sequel (click) 502474 397697 11 119 0 0% 0 0 4.010091
shipit (click) 7587875 6209763 3267 51746 181 0% 0 0 1711.357899
addressable-equality (click) 318740 262062 44 1381 1 0% 0 0 34.114282
addressable-getters (click) 278891 245580 26 863 0 0% 0 0 20.958701
addressable-join (click) 284331 254131 24 941 0 0% 0 0 23.348704
addressable-merge (click) 284357 240320 27 896 0 0% 0 0 22.251811
addressable-new (click) 259075 229644 21 565 0 0% 0 0 14.349878
addressable-normalize (click) 314622 282440 43 1344 1 0% 0 0 33.184629
addressable-parse (click) 281486 214651 26 880 0 0% 0 0 21.72034
addressable-setters (click) 258743 214600 20 582 0 0% 0 0 14.563265
addressable-to-s (click) 278656 220150 26 849 0 0% 0 0 20.713678
binarytrees (click) 7463 7718 6 76 0 0% 0 0 2.895394
blurhash (click) 52292 43311 27 605 0 0% 0 0 17.826849
erubi (click) 235582 225250 6 134 0 0% 0 0 4.042544
etanni (click) 33385 36322 8 114 0 0% 0 0 3.57239
fannkuchredux (click) 24735 32812 3 401 0 0% 0 0 10.796171
fluentd (click) 485325 442852 7 115 0 0% 0 0 3.780802
graphql (click) 411561 354285 73 1921 19 0% 0 0 54.010005
graphql-native (click) 354596 302947 39 532 0 0% 0 0 14.117387
knucleotide (click) 9997 11103 7 113 0 0% 0 0 8.083221
lee (click) 317683 279611 49 1097 0 0% 0 0 31.694208
matmul (click) 11103 4709 8 136 0 0% 0 0 4.25751
nbody (click) 14448 21176 6 251 0 0% 0 0 6.083372
nqueens (click) 22633 28819 5 389 0 0% 0 0 10.146481
optcarrot (click) 325946 290644 188 4740 34 0% 0 0 111.671718
protoboeuf (click) 170129 177717 12 2837 0 0% 0 0 72.924502
protoboeuf-encode (click) 243065 283735 14 1816 0 0% 0 0 44.400237
rack (click) 280566 231702 35 580 0 0% 0 0 15.308282
ruby-json (click) 20323 18532 8 206 0 0% 0 0 5.605438
rubyboy (click) 690768 615288 154 6866 42 0% 0 0 168.65752
rubykon (click) 146441 162602 137 2076 3 0% 0 0 56.815025
sudoku (click) 52278 66593 7 878 0 0% 0 0 23.322543
tinygql (click) 300676 263082 59 1031 5 0% 0 0 27.360138
30k_ifelse (click) 6222887 5052688 9260 75477 0 0% 0 0 1928.697724
30k_methods (click) 2278087 1643066 5780 19370 0 0% 0 0 491.372483
attr_accessor (click) 4349 7928 3 79 0 0% 0 0 2.13164
cfunc_itself (click) 5127 4155 4 53 0 0% 0 0 1.511413
fib (click) 2659 2995 3 30 0 0% 0 0 1.162833
getivar (click) 3789 6778 3 79 0 0% 0 0 1.97315
getivar-module (click) 6752 11953 4 142 0 0% 0 0 3.324198
keyword_args (click) 6332 4965 5 56 0 0% 0 0 1.83921
loops-times (click) 7093 8387 5 100 0 0% 0 0 2.945786
object-new (click) 2406 2818 2 36 0 0% 0 0 1.056768
respond_to (click) 6451 6819 4 80 0 0% 0 0 2.140362
ruby-xor (click) 6037 9212 4 105 0 0% 0 0 2.852305
send_bmethod (click) 5238 4968 6 71 0 0% 0 0 1.759253
send_cfunc_block (click) 14669 12471 5 195 0 0% 0 0 4.264835
send_rubyfunc_block (click) 3904 4074 5 69 0 0% 0 0 1.475315
setivar (click) 2783 3726 3 46 0 0% 0 0 1.29904
setivar_object (click) 3402 3956 3 49 0 0% 0 0 1.42128
setivar_young (click) 4300 4867 4 63 0 0% 0 0 1.739541
str_concat (click) 5799 6969 6 82 0 0% 0 0 2.495154
structaref (click) 4407 9095 3 88 0 0% 0 0 2.363409
structaset (click) 3926 5614 3 70 0 0% 0 0 1.754018
throw (click) 5953 4624 5 53 0 0% 0 0 1.785211

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.