The Computer Language
24.04 Benchmarks Game

Ruby yjit versus Node.js 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.57 86,784 1320 45.93
Ruby yjit #2 139.77 21,120 1462 536.11
Ruby yjit 1,380.34 20,992 391 1,380.29
n-body
source secs mem gz cpu secs
Node.js #6 8.35 46,728 1274 8.36
Ruby yjit #3 188.71 21,248 1169 188.71
Ruby yjit #2 215.31 21,248 1143 215.31
spectral-norm
source secs mem gz cpu secs
Node.js #7 5.36 45,888 420 5.36
Node.js 5.37 47,360 326 5.39
Node.js #6 1.55 94,080 1002 5.92
Ruby yjit 126.55 22,144 299 126.54
Ruby yjit #4 129.16 22,912 333 129.16
Ruby yjit #5 64.82 27,520 764 236.48
mandelbrot
source secs mem gz cpu secs
Node.js #3 4.05 125,696 1128 15.99
Node.js #2 28.35 53,784 422 28.38
Node.js 136.10 48,576 380 136.11
Ruby yjit #5 151.07 86,272 978 603.13
Ruby yjit #4 661.22 136,132 862 661.94
Ruby yjit #2 259.17 94,336 887 1,034.44
Ruby yjit #3 1,538.89 21,120 313 1,538.80
Ruby yjit #6   Failed  
Ruby yjit #7   Failed  
pidigits
source secs mem gz cpu secs
Node.js #4 1.24 50,540 487 1.26
Ruby yjit #5 1.56 850,304 494 1.55
Ruby yjit #2 3.22 2,271,624 666 3.22
Node.js #2 14.18 77,952 405 14.19
Node.js #3 14.19 78,028 431 14.20
Ruby yjit 16.56 104,192 524 16.55
regex-redux
source secs mem gz cpu secs
Node.js #3 4.34 790,368 675 5.44
Node.js #4 5.48 975,456 471 5.65
Ruby yjit #2 23.19 216,576 444 23.19
Ruby yjit #3 11.84 216,576 730 24.21
Ruby yjit #9 30.10 216,576 327 30.09
fasta
source secs mem gz cpu secs
Node.js #5 2.21 100,552 2050 6.20
Ruby yjit #6 23.07 120,064 1070 23.07
Ruby yjit #3 35.52 120,064 1004 35.52
Node.js 40.47 50,244 815 40.80
Ruby yjit #5 91.70 22,784 1000 91.69
Ruby yjit #2 93.97 147,548 747 93.97
Ruby yjit #4 95.74 266,496 864 95.73
k-nucleotide
source secs mem gz cpu secs
Node.js #3 15.38 422,240 1817 41.85
Node.js #2 37.49 479,968 941 112.46
Node.js 39.64 335,272 1011 115.24
Ruby yjit #7 256.92 393,216 792 255.31
Ruby yjit #2 255.78 181,700 426 255.60
Ruby yjit #3 272.84 203,672 546 273.06
Ruby yjit 84.88 172,436 583 300.65
reverse-complement
source secs mem gz cpu secs
Ruby yjit #5 10.77 1,624,300 301 10.76
Ruby yjit #4 6.88 2,510,956 608 12.51
Node.js #2 15.89 717,660 1228 16.53
Ruby yjit #3 9.57 4,232,604 490 17.72
Ruby yjit #2 24.46 1,001,852 272 24.46
Ruby yjit 18.75 5,147,124 521 36.24
Node.js #7   Bad Output  
binary-trees
source secs mem gz cpu secs
Node.js #7 18.49 1,291,392 458 30.94
Node.js #6 9.59 1,275,572 752 32.36
Node.js 9.68 1,230,804 717 35.09
Ruby yjit #4 46.87 478,848 371 46.86
Ruby yjit 48.73 478,976 383 48.72
Ruby yjit #2 48.78 478,976 385 48.76
Ruby yjit #3 50.16 515,924 407 50.14
Ruby yjit #5 18.96 521,984 1016 53.93
Ruby yjit

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

Node.js

v21.7.3