The Computer Language
24.12 Benchmarks Game

Ruby yjit versus Lua fastest performance

How the programs are written matters! Always look at the source code.

If the fastest programs are * hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more seconds, less gz source code.

fannkuch-redux
source secs mem gz cpu secs
Ruby yjit #2 152.41 19,680 1462 591.05
Lua 603.40 19,652 469 603.36
Ruby yjit 1,451.71 19,680 391 1,451.48
Ruby yjit #8 1,932.07 19,680 418 1,931.76
n-body
source secs mem gz cpu secs
Ruby yjit #3 166.55 19,620 1169 166.53
Ruby yjit #2 172.26 19,620 1143 172.23
Lua #2 220.08 19,656 1200 220.07
Lua #4 223.32 19,656 1312 223.30
Lua 262.10 19,656 1207 262.08
Ruby yjit #8 317.96 19,620 1160 317.90
Ruby yjit #7 769.49 19,620 1139 769.35
spectral-norm
source secs mem gz cpu secs
Lua 78.68 19,652 335 78.68
Ruby yjit #4 128.52 22,656 333 128.51
Ruby yjit #8 168.99 21,120 294 168.99
Ruby yjit #5 57.89 27,264 764 212.15
mandelbrot
source secs mem gz cpu secs
Lua #3 345.71 19,656 364 345.68
Lua 348.76 19,656 365 348.74
Lua #2 376.55 19,656 373 376.53
Lua #6 114.06 282,112 630 400.14
Ruby yjit #5 141.70 79,248 978 565.92
Ruby yjit #4 578.95 126,996 853 579.53
Ruby yjit #2 165.71 87,360 887 660.93
Ruby yjit #8 942.59 19,620 364 942.41
Ruby yjit #3 1,695.20 19,620 313 1,694.90
Ruby yjit #6   Timed Out  
Ruby yjit #7   Timed Out  
fasta
source secs mem gz cpu secs
Lua #3 24.08 19,652 1065 24.08
Lua #2 24.15 19,652 1065 24.14
Ruby yjit #6 34.00 113,008 1097 33.99
Ruby yjit #3 43.54 113,048 1035 43.53
Ruby yjit #2 82.85 136,432 747 82.83
Ruby yjit #5 99.25 19,620 1000 99.23
Ruby yjit #4 142.74 294,212 864 142.15
Ruby yjit #8 190.64 19,620 700 190.20
k-nucleotide
source secs mem gz cpu secs
Lua #2 97.17 596,604 620 97.16
Ruby yjit #7 255.31 385,864 792 253.65
Ruby yjit #2 263.04 171,524 426 262.74
Ruby yjit #3 300.38 198,360 546 300.61
Ruby yjit 87.40 162,976 583 318.58
Ruby yjit #8 529.77 599,256 529 529.29
reverse-complement
source secs mem gz cpu secs
Ruby yjit #4 6.11 2,491,828 608 11.94
Ruby yjit #5 13.38 1,602,784 301 13.37
Ruby yjit #3 8.36 4,458,064 490 16.48
Ruby yjit #2 19.55 503,176 272 19.54
Ruby yjit 13.21 5,556,616 521 25.63
Lua #2 41.12 2,654,652 560 41.10
Lua #5 41.96 2,169,636 758 41.96
Lua #4 49.35 1,030,016 600 49.33
binary-trees
source secs mem gz cpu secs
Ruby yjit #4 46.97 472,012 371 46.94
Ruby yjit 48.77 471,992 383 48.75
Ruby yjit #2 48.83 471,996 385 48.80
Ruby yjit #3 49.58 507,116 407 49.55
Ruby yjit #5 18.85 473,532 1016 53.80
Ruby yjit #8 135.03 471,944 494 134.99
Lua #2 141.55 956,672 418 141.52
Lua #3 83.71 809,856 690 167.26
Lua #4 48.65 956,672 670 180.27
pidigits
source secs mem gz cpu secs
Ruby yjit 18.03 49,168 524 18.03
* Lua #7   Failed  
Ruby yjit #2   Failed  
* Lua #5   Failed  
Ruby yjit #5   Failed  
* Lua   Failed  
regex-redux
source secs mem gz cpu secs
Ruby yjit #2 23.47 212,160 444 23.47
Ruby yjit #3 12.36 208,604 730 24.37
Ruby yjit #9 30.70 212,104 340 30.69
Lua   Failed  
Ruby yjit

ruby 3.4.0dev
(2024-12-25
master f450108330)
+YJIT +PRISM [x86_64-linux]

Lua

Lua 5.4.6 Copyright (C)
1994-2023 Lua.org, PUC-Rio