Ruby Benchmarks

Details for Benchmarks at 2025-11-10 00:42:00 UTC

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

Using the geomean of the headline benchmarks for x86 YJIT 4.0.0dev is
  • 91.6% faster than CRuby 4.0.0dev
  • the same speed as YJIT 3.4.7
On railsbench it is
  • 100.1% faster than CRuby 4.0.0dev
  • 1.7% faster than YJIT 3.4.7
x86_64 runtime: 7 hours, 23 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 83 5 85 50 194 50 209
chunky-png 5 31 5 32 50 33 50 27
erubi-rails 5 15 5 15 50 10 50 10
hexapdf 5 10 5 10 50 10 50 10
liquid-c 5 422 5 391 50 630 50 548
liquid-compile 5 417 5 467 50 546 50 694
liquid-render 5 172 5 164 50 433 50 384
lobsters 5 20 5 20 50 10 50 10
mail 5 195 5 171 50 254 50 211
psych-load 5 10 5 10 50 10 50 10
railsbench 5 10 5 10 50 10 50 10
rubocop 5 154 5 157 50 248 50 247
ruby-lsp 5 142 5 146 50 229 50 241
sequel 5 419 5 427 50 583 50 575
shipit 5 10 5 10 50 10 50 10
binarytrees 5 82 5 82 50 136 50 126
blurhash 5 83 5 87 50 143 50 144
erubi 5 128 5 131 50 137 50 126
etanni 5 98 5 63 50 71 50 30
fannkuchredux 5 54 5 56 50 102 50 99
fluentd 5 56 5 56 50 21 50 29
graphql 5 370 5 454 50 535 50 917
graphql-native 5 59 5 82 50 22 50 62
knucleotide 5 163 5 155 50 117 50 109
lee 5 23 5 22 50 10 50 10
matmul 5 51 5 50 50 94 50 90
nbody 5 247 5 257 50 676 50 653
nqueens 5 116 5 129 50 556 50 554
optcarrot 5 10 5 10 50 10 50 10
protoboeuf 5 176 5 175 50 707 50 643
protoboeuf-encode 5 197 5 200 50 830 50 789
rack 5 440 5 435 50 707 50 678
ruby-json 5 82 5 92 50 47 50 65
rubyboy 5 10 5 10 50 10 50 10
rubykon 5 21 5 20 50 10 50 10
sudoku 5 48 5 48 50 156 50 149
tinygql 5 40 5 42 50 35 50 46
30k_ifelse 5 28 5 28 50 186 50 184
30k_methods 5 38 5 40 50 458 50 457
attr_accessor 5 157 5 208 50 1836 50 1934
cfunc_itself 5 347 5 351 50 1255 50 1259
fib 5 124 5 144 50 939 50 940
getivar 5 217 5 289 50 2316 50 2402
keyword_args 5 100 5 103 50 1240 50 1242
loops-times 5 23 5 25 50 64 50 56
object-new 5 269 5 354 50 297 50 597
respond_to 5 139 5 131 50 3886 50 3900
ruby-xor 5 237 5 251 50 1314 50 1276
send_bmethod 5 116 5 115 50 5538 50 5536
send_cfunc_block 5 107 5 104 50 353 50 304
send_rubyfunc_block 5 250 5 255 50 6925 50 6917
setivar 5 360 5 339 50 4925 50 4913
setivar_object 5 341 5 331 50 750 50 582
setivar_young 5 341 5 331 50 799 50 614
str_concat 5 390 5 385 50 1202 50 999
structaref 5 155 5 207 50 1812 50 1906
throw 5 1090 5 1255 50 1413 50 1598

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) 1550621 1324080 205 2579 0 0% 0 0 77.859474
chunky-png (click) 317279 243416 74 1322 1 0% 0 0 37.493031
erubi-rails (click) 1374918 1178267 267 3653 22 0% 0 0 97.69512
hexapdf (click) 1525905 1375698 593 15680 44 0% 0 0 437.250174
liquid-c (click) 556290 471575 114 2228 5 0% 0 0 58.791934
liquid-compile (click) 477964 422383 146 2708 2 0% 0 0 79.117423
liquid-render (click) 662417 603172 131 2946 8 0% 0 0 79.419555
lobsters (click) 8536439 6979882 3100 62517 118 0% 0 0 2164.145582
mail (click) 865001 818837 342 7696 40 0% 0 0 212.698502
psych-load (click) 288952 258996 61 832 2 0% 0 0 23.868787
railsbench (click) 3365593 2855312 1605 19667 47 0% 0 0 558.291833
rubocop (click) 5763106 4984520 3001 56874 125 0% 6 0 1658.394408
ruby-lsp (click) 961918 817109 347 6784 44 0% 1 0 182.799095
sequel (click) 504297 449535 11 119 0 0% 0 0 3.881845
shipit (click) 7606574 6426998 3262 51879 180 0% 0 0 1710.070625
binarytrees (click) 7463 7718 6 76 0 0% 0 0 2.911384
blurhash (click) 52292 43311 27 605 0 0% 0 0 17.911903
erubi (click) 248180 182795 6 134 0 0% 0 0 3.983126
etanni (click) 32930 35718 8 114 0 0% 0 0 3.647792
fannkuchredux (click) 24735 32812 3 401 0 0% 0 0 10.920916
fluentd (click) 490404 458596 7 115 0 0% 0 0 3.705285
graphql (click) 410388 353818 73 1921 19 0% 0 0 54.013443
graphql-native (click) 354838 287658 39 532 0 0% 0 0 14.256675
knucleotide (click) 9997 11103 7 113 0 0% 0 0 7.098867
lee (click) 316924 287948 49 1097 0 0% 0 0 31.676968
matmul (click) 11103 4709 8 136 0 0% 0 0 4.255573
nbody (click) 14448 21176 6 251 0 0% 0 0 6.117216
nqueens (click) 22633 28819 5 389 0 0% 0 0 10.262615
optcarrot (click) 325946 290644 188 4740 34 0% 0 0 111.31535
protoboeuf (click) 170129 177717 12 2837 0 0% 0 0 72.291886
protoboeuf-encode (click) 243065 283735 14 1816 0 0% 0 0 44.152695
rack (click) 286114 239873 35 654 0 0% 0 0 17.140135
ruby-json (click) 19868 17928 8 206 0 0% 0 0 5.606658
rubyboy (click) 703554 564420 154 6862 42 0% 0 0 167.502213
rubykon (click) 146441 162602 137 2076 3 0% 0 0 56.562929
sudoku (click) 52278 66593 7 878 0 0% 0 0 23.189743
tinygql (click) 300316 271668 59 1025 5 0% 0 0 27.142411
30k_ifelse (click) 6222887 5052688 9260 75477 0 0% 0 0 1920.902496
30k_methods (click) 2278087 1643066 5780 19370 0 0% 0 0 493.759551
attr_accessor (click) 4349 7928 3 79 0 0% 0 0 2.139249
cfunc_itself (click) 5127 4155 4 53 0 0% 0 0 1.53658
fib (click) 2659 2995 3 30 0 0% 0 0 1.119901
getivar (click) 3789 6778 3 79 0 0% 0 0 1.964537
keyword_args (click) 6332 4965 5 56 0 0% 0 0 1.854881
loops-times (click) 7093 8387 5 100 0 0% 0 0 2.890566
object-new (click) 2406 2818 2 36 0 0% 0 0 1.113985
respond_to (click) 6451 6819 4 80 0 0% 0 0 2.167219
ruby-xor (click) 6026 856 4 105 0 0% 0 0 2.834866
send_bmethod (click) 5238 4968 6 71 0 0% 0 0 1.741041
send_cfunc_block (click) 14669 12471 5 195 0 0% 0 0 4.313483
send_rubyfunc_block (click) 3904 4074 5 69 0 0% 0 0 1.504783
setivar (click) 2783 3726 3 46 0 0% 0 0 1.309061
setivar_object (click) 3402 3956 3 49 0 0% 0 0 1.460685
setivar_young (click) 4300 4867 4 63 0 0% 0 0 1.756737
str_concat (click) 5799 6969 6 82 0 0% 0 0 2.460029
structaref (click) 4407 9095 3 88 0 0% 0 0 2.381768
throw (click) 5953 4624 5 53 0 0% 0 0 1.809345

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.