The Computer Language
24.12 Benchmarks Game

Ruby yjit versus Perl 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
Perl #3 1,365.70 19,684 433 1,365.66
Ruby yjit 1,451.71 19,680 391 1,451.48
Perl #2 442.57 19,684 577 1,766.92
Perl 1,805.89 19,684 463 1,805.83
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
Ruby yjit #8 317.96 19,620 1160 317.90
Perl #2 444.89 19,688 1431 444.87
Ruby yjit #7 769.49 19,620 1139 769.35
spectral-norm
source secs mem gz cpu secs
Perl #5 96.53 19,688 346 96.53
Perl 96.60 19,688 340 96.59
Perl #4 24.86 19,688 562 97.92
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
Perl #3 126.48 19,688 857 498.55
Perl #2 508.73 19,688 350 508.70
mandelbrot
source secs mem gz cpu secs
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
Perl 498.72 76,928 592 1,979.43
Ruby yjit #6   Timed Out  
Ruby yjit #7   Timed Out  
fasta
source secs mem gz cpu secs
Ruby yjit #6 34.00 113,008 1097 33.99
Ruby yjit #3 43.54 113,048 1035 43.53
Perl 60.07 55,296 875 60.07
Ruby yjit #2 82.85 136,432 747 82.83
Ruby yjit #5 99.25 19,620 1000 99.23
Perl #4 126.60 19,684 969 125.89
Ruby yjit #4 142.74 294,212 864 142.15
Perl #2 189.89 19,684 926 189.24
Ruby yjit #8 190.64 19,620 700 190.20
k-nucleotide
source secs mem gz cpu secs
Perl #2 139.32 659,584 365 137.50
Perl #4 45.38 1,070,336 483 151.76
Perl 43.90 1,247,396 659 154.01
Perl #3 56.61 1,148,032 520 193.68
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
Perl #4 5.76 998,608 268 5.76
Perl #3 6.77 1,495,228 295 6.76
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
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
Perl #6 40.21 760,192 800 148.50
Perl #5 52.18 1,048,704 805 189.88
Perl 263.97 599,424 401 263.95
Perl #4 79.54 2,519,560 769 287.74
Perl #3 110.37 2,200,700 655 374.11
pidigits
source secs mem gz cpu secs
Perl 13.27 19,684 471 13.26
Ruby yjit 18.03 49,168 524 18.03
Perl #2   Failed  
Perl #4   Failed  
Ruby yjit #2   Failed  
Ruby yjit #5   Failed  
regex-redux
source secs mem gz cpu secs
Perl 22.28 205,748 471 22.28
Ruby yjit #2 23.47 212,160 444 23.47
Ruby yjit #3 12.36 208,604 730 24.37
Perl #2 17.06 205,440 717 29.44
Perl #4 10.21 157,444 823 30.52
Ruby yjit #9 30.70 212,104 340 30.69
Perl #3 10.36 410,236 857 30.81
Perl #5   Bad Output  
Ruby yjit

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

Perl

This is perl 5, version 40
subversion 0 (v5.40.0)
x86_64-linux-thread-multi