The Computer Language
24.11 Benchmarks Game

Node.js versus C gcc 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
* C gcc #6 2.14 19,704 1582 8.43
* C gcc #4 14.04 19,704 1190 14.03
C gcc #5 7.29 19,704 917 28.25
C gcc #3 36.80 19,704 574 36.79
C gcc #8 39.33 19,492 483 39.32
C gcc 39.61 19,704 514 39.60
* C gcc #2 10.19 19,704 1563 39.99
Node.js #5 11.05 101,616 1320 43.85
Node.js #8 58.06 51,484 452 58.05
n-body
source secs mem gz cpu secs
* C gcc #9 2.10 19,772 1639 2.10
* C gcc #4 4.05 19,772 1398 4.05
C gcc #6 4.97 19,772 1186 4.97
C gcc #2 5.19 19,772 1270 5.19
C gcc #3 5.23 19,772 1214 5.23
C gcc 5.23 19,772 1179 5.23
* C gcc #5 5.43 19,772 1436 5.43
C gcc #8 5.54 19,492 1193 5.54
C gcc #7 6.89 19,772 1250 6.88
Node.js #6 8.55 54,100 1274 8.56
Node.js #8 9.58 53,716 1173 9.59
spectral-norm
source secs mem gz cpu secs
* C gcc #6 0.40 19,772 1203 1.59
* C gcc #5 0.72 19,772 576 2.85
* C gcc #7 0.72 19,772 906 2.85
* C gcc #4 0.72 19,772 1145 2.85
Node.js #7 5.36 53,724 420 5.37
Node.js 5.37 54,808 326 5.39
C gcc #8 5.40 19,772 389 5.39
C gcc #3 1.43 19,772 470 5.70
Node.js #6 1.56 107,280 1002 5.99
Node.js #8 6.49 54,632 355 6.50
* C gcc #2   Make Error  
mandelbrot
source secs mem gz cpu secs
* C gcc #6 1.28 33,400 1147 5.10
C gcc #5 1.63 33,512 788 6.31
* C gcc #4 3.52 33,060 805 13.89
* C gcc 3.49 32,864 828 13.92
* C gcc #7 3.51 33,276 1000 13.95
* C gcc #3 3.53 32,860 769 14.09
C gcc #9 4.07 33,128 700 15.70
Node.js #3 4.00 135,476 1128 15.83
C gcc #8 25.15 19,496 412 25.15
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
fasta
source secs mem gz cpu secs
C gcc #9 0.78 19,772 1469 0.78
C gcc #5 1.24 19,772 1286 1.24
C gcc #7 2.76 19,772 1299 2.76
C gcc #6 0.94 19,772 1936 2.78
C gcc #2 0.82 19,772 2276 3.24
C gcc 3.70 19,772 1213 3.70
C gcc #8 4.62 19,772 825 4.62
* Node.js #5 2.52 112,392 2050 7.08
Node.js 38.40 58,880 815 38.77
Node.js #8 531.27 62,400 723 531.53
C gcc #4   Make Error  
k-nucleotide
source secs mem gz cpu secs
C gcc 3.84 130,408 1512 12.45
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
Node.js #8   Bad Output  
reverse-complement
source secs mem gz cpu secs
* C gcc #7 0.44 499,992 1899 0.59
C gcc #9 0.48 500,032 1551 0.76
C gcc #6 0.96 675,260 828 1.36
C gcc #5 1.53 994,108 654 1.53
C gcc #2 1.06 994,536 757 1.58
* C gcc #4 3.70 500,452 716 3.69
* Node.js #2 15.44 731,804 1228 16.09
* Node.js #7   Bad Output  
binary-trees
source secs mem gz cpu secs
C gcc #2 1.53 169,284 816 4.18
C gcc #3 1.96 134,540 842 4.70
C gcc #8 21.08 285,544 607 21.08
C gcc 21.67 264,244 660 21.67
Node.js #7 16.02 1,070,260 458 28.26
Node.js #6 8.60 1,250,816 752 30.68
C gcc #5 8.77 351,332 914 31.93
Node.js #8 19.86 1,334,104 521 32.74
Node.js 8.92 1,405,276 717 33.60
pidigits
source secs mem gz cpu secs
C gcc #2 0.74 19,772 422 0.74
C gcc 0.74 19,772 459 0.74
Node.js #4 1.11 59,620 487 1.14
Node.js #2 12.16 87,228 405 12.19
Node.js #3 12.25 87,708 431 12.28
regex-redux
source secs mem gz cpu secs
C gcc #5 0.81 152,500 1403 2.03
C gcc #2 3.21 103,288 1121 3.21
C gcc #4 0.97 152,264 1237 3.28
C gcc #3 1.72 103,736 1273 3.31
Node.js #3 4.27 796,080 675 5.30
Node.js #4 5.41 978,952 471 5.56
Node.js

v23.0.0

C gcc

gcc (Ubuntu 14.2.0-4ubuntu2) 14.2.0