The Computer Language
24.11 Benchmarks Game

Node.js versus Ruby yjit 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
Node.js #5 11.05 101,616 1320 43.85
Node.js #8 58.06 51,484 452 58.05
Ruby yjit #2 139.05 21,120 1462 521.30
Ruby yjit 1,354.19 20,864 391 1,354.14
Ruby yjit #8 1,980.46 20,736 418 1,980.37
n-body
source secs mem gz cpu secs
Node.js #6 8.55 54,100 1274 8.56
Node.js #8 9.58 53,716 1173 9.59
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
Ruby yjit #7 704.57 21,120 1139 704.53
spectral-norm
source secs mem gz cpu secs
Node.js #7 5.36 53,724 420 5.37
Node.js 5.37 54,808 326 5.39
Node.js #6 1.56 107,280 1002 5.99
Node.js #8 6.49 54,632 355 6.50
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
Node.js #3 4.00 135,476 1128 15.83
Node.js #2 29.36 61,144 422 29.39
Node.js 70.55 55,900 380 70.64
Node.js #8 72.49 56,116 412 72.52
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
Ruby yjit #6   Failed  
Ruby yjit #7   Failed  
fasta
source secs mem gz cpu secs
* Node.js #5 2.52 112,392 2050 7.08
Node.js #8 18.42 61,784 742 18.61
Ruby yjit #6 31.90 120,832 1097 31.90
Node.js 38.40 58,880 815 38.77
Ruby yjit #3 43.90 120,576 1035 43.90
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
Ruby yjit #8 188.45 21,428 700 187.83
k-nucleotide
source secs mem gz cpu secs
Node.js #3 16.48 436,784 1817 44.54
Node.js #2 38.24 486,844 941 112.58
Node.js 39.98 356,716 1011 117.63
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
Node.js #8   Bad Output  
reverse-complement
source secs mem gz cpu secs
Ruby yjit #4 5.88 2,510,920 608 11.51
Ruby yjit #5 14.12 1,623,336 301 14.11
* Node.js #2 15.44 731,804 1228 16.09
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
* Node.js #7   Bad Output  
binary-trees
source secs mem gz cpu secs
Node.js #7 16.02 1,070,260 458 28.26
Node.js #6 8.60 1,250,816 752 30.68
Node.js #8 19.86 1,334,104 521 32.74
Node.js 8.92 1,405,276 717 33.60
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
pidigits
source secs mem gz cpu secs
Node.js #4 1.11 59,620 487 1.14
Ruby yjit #5 1.50 1,011,072 494 1.50
Ruby yjit #2 3.10 2,431,144 666 3.09
Node.js #2 12.16 87,228 405 12.19
Node.js #3 12.25 87,708 431 12.28
Ruby yjit 17.73 104,576 524 17.72
regex-redux
source secs mem gz cpu secs
Node.js #3 4.27 796,080 675 5.30
Node.js #4 5.41 978,952 471 5.56
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
Node.js

v23.0.0

Ruby yjit

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