The Computer Language
24.11 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 139.05 21,120 1462 521.30
Ruby yjit 1,354.19 20,864 391 1,354.14
Perl #3 1,365.70 19,684 433 1,365.66
Perl #2 442.57 19,684 577 1,766.92
Perl 1,805.89 19,684 463 1,805.83
Ruby yjit #8 1,980.46 20,736 418 1,980.37
n-body
source secs mem gz cpu secs
Ruby yjit #3 186.79 20,864 1169 186.79
Ruby yjit #2 215.78 20,864 1143 215.77
Ruby yjit #8 388.21 21,376 1160 388.20
Perl #2 444.89 19,688 1431 444.87
Ruby yjit #7 704.57 21,120 1139 704.53
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 150.28 86,144 978 600.37
Ruby yjit #4 652.14 135,516 853 652.89
Ruby yjit #2 254.39 93,952 887 1,016.26
Ruby yjit #8 1,507.03 21,428 364 1,506.75
Ruby yjit #3 1,588.59 20,992 313 1,588.52
Perl 498.72 76,928 592 1,979.43
Ruby yjit #6   Failed  
Ruby yjit #7   Failed  
fasta
source secs mem gz cpu secs
Ruby yjit #6 31.90 120,832 1097 31.90
Ruby yjit #3 43.90 120,576 1035 43.90
Perl 60.07 55,296 875 60.07
Ruby yjit #5 90.76 23,168 1000 90.75
Ruby yjit #4 95.10 266,624 864 95.09
Ruby yjit #2 106.06 147,176 747 106.05
Perl #4 126.60 19,684 969 125.89
Perl #2 189.89 19,684 926 189.24
Ruby yjit #8 270.10 27,768 678 269.94
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 #2 252.78 181,808 426 252.58
Ruby yjit #3 277.67 207,596 546 277.88
Ruby yjit #7 300.36 392,960 792 298.86
Ruby yjit 86.11 171,696 583 302.91
Ruby yjit #8 788.25 572,736 529 787.84
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 5.88 2,510,920 608 11.51
Ruby yjit #5 14.12 1,623,336 301 14.11
Ruby yjit #3 8.95 4,235,052 490 17.34
Ruby yjit #2 27.45 1,001,920 272 27.45
Ruby yjit 18.31 5,141,976 521 35.91
binary-trees
source secs mem gz cpu secs
Ruby yjit #4 47.23 478,464 371 47.22
Ruby yjit 48.86 478,592 383 48.85
Ruby yjit #2 48.90 524,800 385 48.89
Ruby yjit #3 49.82 517,080 407 49.81
Ruby yjit #5 19.08 521,972 1016 54.19
Ruby yjit #8 130.97 478,720 494 130.95
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
Ruby yjit #5 1.50 1,011,072 494 1.50
Ruby yjit #2 3.10 2,431,144 666 3.09
Perl 13.27 19,684 471 13.26
Ruby yjit 17.73 104,576 524 17.72
Perl #2   Failed  
Perl #4   Failed  
regex-redux
source secs mem gz cpu secs
Perl 22.28 205,748 471 22.28
Ruby yjit #2 22.86 216,576 444 22.87
Ruby yjit #3 11.84 216,576 730 23.97
Perl #2 17.06 205,440 717 29.44
Ruby yjit #9 29.92 216,704 340 29.91
Perl #4 10.21 157,444 823 30.52
Perl #3 10.36 410,236 857 30.81
Perl #5   Bad Output  
Ruby yjit

ruby 3.3.5
(2024-09-03
revision ef084cc8f4)
+YJIT [x86_64-linux]

Perl

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