The Computer Language
24.11 Benchmarks Game

Ruby yjit versus Python 3 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
Python 3 #6 1,033.31 19,312 391 1,033.27
Python 3 #4 302.37 19,312 960 1,196.45
Ruby yjit 1,354.19 20,864 391 1,354.14
Ruby yjit #8 1,980.46 20,736 418 1,980.37
Python 3 #8 2,259.59 19,312 414 2,259.50
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
Python 3 355.06 19,312 1201 355.05
Python 3 #2 374.16 19,312 1247 374.14
Ruby yjit #8 388.21 21,376 1160 388.20
Python 3 #8 518.11 19,312 1172 518.09
Ruby yjit #7 704.57 21,120 1139 704.53
spectral-norm
source secs mem gz cpu secs
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
Python 3 #6 347.53 19,316 334 347.52
Python 3 #4 90.52 19,308 415 359.95
Python 3 #8 379.97 19,440 334 379.96
Python 3 #7 97.11 19,316 425 380.79
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
Python 3 #7 172.20 19,312 698 687.68
Python 3 #3 861.76 19,312 319 861.73
Python 3 #2 235.71 95,164 790 926.30
Ruby yjit #2 254.39 93,952 887 1,016.26
Python 3 #5 257.00 19,312 463 1,026.96
Ruby yjit #8 1,507.03 21,428 364 1,506.75
Python 3 #8 1,528.00 19,364 379 1,527.73
Ruby yjit #3 1,588.59 20,992 313 1,588.52
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
Python 3 #2 39.00 19,312 1126 39.00
Python 3 #3 39.12 19,312 1007 39.12
Ruby yjit #3 43.90 120,576 1035 43.90
Python 3 #5 27.86 827,284 1951 53.94
Python 3 57.21 19,312 823 57.20
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
Python 3 #8 259.98 19,312 730 259.80
Ruby yjit #8 270.10 27,768 678 269.94
k-nucleotide
source secs mem gz cpu secs
Python 3 #3 50.15 262,368 1970 185.77
Python 3 #4 79.01 506,112 663 236.67
Python 3 238.45 499,072 499 237.78
Python 3 #8 238.78 623,448 525 237.93
Python 3 #9 68.33 379,392 614 238.74
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
Python 3 #3 4.86 507,712 803 4.86
Python 3 #5 4.09 1,500,716 960 7.41
Python 3 #2 10.08 1,788,136 440 10.08
Python 3 10.29 1,986,440 484 10.29
Python 3 #6 7.38 2,484,372 821 10.89
Ruby yjit #4 5.88 2,510,920 608 11.51
Python 3 #4 13.41 4,002,688 343 13.41
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
Python 3 #2 100.90 271,872 344 100.89
Python 3 #4 33.61 276,992 481 121.96
Python 3 #5 35.49 274,816 669 126.17
Python 3 36.12 276,992 597 127.68
Ruby yjit #8 130.97 478,720 494 130.95
Python 3 #3 52.28 671,872 1247 149.07
Python 3 #8 558.92 798,336 535 558.85
pidigits
source secs mem gz cpu secs
* Python 3 #3 1.26 19,312 573 1.26
Ruby yjit #5 1.50 1,011,072 494 1.50
Ruby yjit #2 3.10 2,431,144 666 3.09
Python 3 #4 4.54 19,312 348 4.54
Ruby yjit 17.73 104,576 524 17.72
Python 3 #5   Failed  
regex-redux
source secs mem gz cpu secs
* Python 3 #2 1.35 168,236 1411 2.64
Python 3 8.91 432,220 515 16.44
Ruby yjit #2 22.86 216,576 444 22.87
Ruby yjit #3 11.84 216,576 730 23.97
Ruby yjit #9 29.92 216,704 340 29.91
Ruby yjit

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

Python 3

Python 3.13.0