The Computer Language
23.02 Benchmarks Game

Ruby versus Node js fastest performance

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.08 81,124 1313 43.87
Ruby #2 169.71 29,140 1455 656.90
Ruby 1,466.53 24,936 384 1,466.47
n-body
source secs mem gz cpu secs
Node js #6 8.41 45,908 1268 9.39
Ruby #3 190.96 25,644 1163 190.95
Ruby #2 218.13 25,684 1137 218.04
spectral-norm
source secs mem gz cpu secs
Node js #7 5.36 46,704 414 5.37
Node js 5.44 47,212 319 5.45
Node js #6 1.66 88,700 999 6.10
Ruby #4 134.68 27,356 326 134.67
Ruby 136.75 26,644 292 136.69
Ruby #5 57.56 28,488 758 210.10
mandelbrot
source secs mem gz cpu secs
Node js #3 4.03 118,432 1122 15.92
Node js #2 28.20 53,644 416 28.23
Node js 130.80 49,372 373 130.71
Ruby #5 155.55 93,112 970 619.59
Ruby #4 747.10 145,736 857 746.96
Ruby #2 255.19 95,912 880 1,015.91
Ruby #3 1,526.22 25,276 307 1,526.08
Ruby #6   Failed  
Ruby #7   Failed  
pidigits
source secs mem gz cpu secs
Node js #4 1.26 49,328 481 1.28
Node js #2 12.95 78,356 397 12.97
Node js #3 13.09 78,112 424 13.11
Ruby 17.24 167,116 518 17.24
Ruby #2   Failed  
Ruby #5   Failed  
regex-redux
source secs mem gz cpu secs
Node js #3 4.51 768,724 668 5.58
Node js #4 5.76 991,704 463 5.93
Ruby #3 12.56 217,132 724 24.73
Ruby #2 24.86 242,680 437 24.84
Ruby #9 29.71 217,156 321 29.71
fasta
source secs mem gz cpu secs
Node js #5 2.20 94,408 2047 6.32
Ruby #6 26.18 124,704 1069 26.18
Node js 33.14 54,432 809 33.43
Ruby #3 46.23 124,612 1002 46.23
Ruby #2 105.47 223,092 743 105.46
Ruby #5 112.99 27,152 995 112.98
Ruby #4 113.43 269,460 860 113.28
k-nucleotide
source secs mem gz cpu secs
Node js #3 15.72 416,500 1812 43.32
Node js #2 37.55 486,856 935 116.51
Node js 40.21 518,808 1008 117.96
Ruby #2 249.91 202,672 420 249.53
Ruby #3 285.77 209,580 540 285.36
Ruby #7 289.86 397,756 785 287.45
Ruby 83.82 174,084 576 291.63
reverse-complement
source secs mem gz cpu secs
Ruby #4 5.60 2,506,468 601 11.05
Ruby #5 11.77 1,615,676 295 11.77
Ruby #3 8.25 4,445,520 482 15.86
Node js #2 15.94 731,396 1221 16.58
Ruby #2 23.00 1,003,740 264 23.00
Ruby 17.18 5,610,896 514 33.33
Node js #7   Bad Output  
binary-trees
source secs mem gz cpu secs
Node js 6.37 1,295,776 711 19.51
Node js #6 8.22 1,257,276 744 24.87
Node js #7 33.78 1,135,992 451 38.12
Ruby #4 46.86 569,364 364 46.85
Ruby #2 48.74 569,392 378 48.73
Ruby 48.74 569,348 376 48.74
Ruby #3 50.83 402,724 400 50.80
Ruby #5 18.36 565,588 1008 52.32
Ruby

ruby 3.2.0
(2022-12-25
revision a528908271)
+YJIT [x86_64-linux]

Node js

build 19.0.1+10-21