The Computer Language
24.06 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 140.37 21,120 1462 538.20
Python 3 #6 895.57 19,652 391 895.53
Python 3 #4 291.14 19,652 960 1,150.83
Ruby yjit 1,418.84 20,864 391 1,418.77
n-body
source secs mem gz cpu secs
Ruby yjit #3 189.13 21,120 1169 189.12
Ruby yjit #2 215.86 21,120 1143 215.85
Python 3 354.45 19,652 1201 354.43
Python 3 #2 360.53 19,652 1247 360.52
spectral-norm
source secs mem gz cpu secs
Ruby yjit 128.41 22,016 299 128.41
Ruby yjit #4 129.81 22,912 333 129.81
Ruby yjit #5 64.44 27,392 764 237.59
Python 3 #7 85.35 19,660 425 338.99
Python 3 #6 343.12 19,660 334 343.11
Python 3 #8 89.19 19,660 415 354.24
mandelbrot
source secs mem gz cpu secs
Ruby yjit #5 151.49 86,272 978 604.82
Python 3 #7 158.82 19,652 698 634.14
Ruby yjit #4 676.40 141,140 853 677.25
Python 3 #3 813.16 19,652 319 813.13
Python 3 #2 212.22 102,584 790 846.26
Python 3 #5 247.80 19,652 463 989.79
Ruby yjit #2 259.84 94,336 887 1,037.40
Ruby yjit #3 1,592.43 20,992 313 1,592.34
Ruby yjit #6   Failed  
Ruby yjit #7   Timed Out  
pidigits
source secs mem gz cpu secs
Python 3 #3 1.33 19,652 573 1.33
Ruby yjit #5 1.57 852,480 494 1.57
Ruby yjit #2 3.18 2,172,920 666 3.18
Python 3 #4 4.61 19,652 348 4.61
Ruby yjit 16.81 104,064 524 16.81
Python 3 #5   Failed  
regex-redux
source secs mem gz cpu secs
Python 3 #2 1.35 168,036 1411 2.63
Python 3 8.84 432,748 515 16.23
Ruby yjit #2 23.24 216,448 444 23.26
Ruby yjit #3 11.90 216,576 730 24.25
Ruby yjit #9 30.14 216,448 340 30.13
fasta
source secs mem gz cpu secs
Ruby yjit #6 23.18 120,064 1097 23.18
Ruby yjit #3 35.74 120,064 1035 35.73
Python 3 #2 37.94 19,652 1126 37.94
Python 3 #3 38.31 19,652 1007 38.30
Python 3 #5 28.13 827,220 1951 55.72
Python 3 57.01 19,652 823 57.01
Ruby yjit #5 92.44 22,656 1000 92.43
Ruby yjit #2 94.45 147,516 747 94.45
Ruby yjit #4 96.56 266,368 864 96.55
k-nucleotide
source secs mem gz cpu secs
Python 3 #3 50.62 262,400 1970 193.35
Python 3 #8 73.69 506,368 663 226.37
Python 3 #9 63.78 379,776 614 228.11
Python 3 232.37 499,456 499 231.68
Ruby yjit #7 257.65 393,216 792 256.07
Ruby yjit #2 257.07 181,696 426 256.91
Ruby yjit #3 268.72 203,648 546 269.07
Ruby yjit 85.20 172,720 583 303.81
reverse-complement
source secs mem gz cpu secs
Python 3 #3 4.82 508,760 803 4.82
Python 3 #5 4.03 1,500,508 960 7.30
Ruby yjit #5 9.94 1,624,104 301 9.94
Python 3 #2 10.13 1,788,624 440 10.12
Python 3 10.36 1,986,924 484 10.36
Python 3 #6 7.71 2,484,208 821 11.18
Ruby yjit #4 5.89 2,511,208 608 11.52
Python 3 #4 13.85 4,003,072 343 13.85
Ruby yjit #3 9.05 3,935,068 490 17.39
Ruby yjit #2 24.38 1,001,932 272 24.37
Ruby yjit 18.71 5,147,824 521 36.50
binary-trees
source secs mem gz cpu secs
Ruby yjit #4 47.07 478,848 371 47.06
Ruby yjit #2 48.94 478,720 385 48.92
Ruby yjit 48.93 478,848 383 48.92
Ruby yjit #3 49.89 616,792 407 49.88
Ruby yjit #5 19.06 522,120 1016 54.07
Python 3 #2 105.82 272,384 344 105.81
Python 3 #5 34.55 274,944 669 123.08
Python 3 35.50 277,632 597 126.38
Python 3 #4 34.68 277,504 481 127.31
Python 3 #3 49.75 672,384 1247 143.18
Ruby yjit

ruby 3.3.0
(2023-12-25
revision 5124f9ac75)
+YJIT [x86_64-linux]

Python 3

Python 3.12.3