The Computer Language
24.11 Benchmarks Game

Java 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
Java #3 39.96 44,308 1264 40.06
Java 10.85 44,612 1289 42.80
Node.js #5 11.05 101,616 1320 43.85
Java #2 45.77 42,552 520 45.83
Java #8 45.90 42,568 517 45.97
Node.js #8 58.06 51,484 452 58.05
n-body
source secs mem gz cpu secs
Java #4 6.88 42,028 1495 6.91
Java #5 7.30 43,424 1435 7.36
Java #2 7.48 42,260 1430 7.52
Java #3 7.49 42,292 1436 7.52
Java #8 7.59 42,924 1322 7.64
Java 7.84 42,652 1437 7.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
Node.js #7 5.36 53,724 420 5.37
Node.js 5.37 54,808 326 5.39
Java #8 5.43 43,368 453 5.49
Java #3 1.57 44,160 762 5.93
Node.js #6 1.56 107,280 1002 5.99
Java #2 1.61 43,028 956 6.08
Node.js #8 6.49 54,632 355 6.50
mandelbrot
source secs mem gz cpu secs
Node.js #3 4.00 135,476 1128 15.83
Java #2 4.08 82,216 802 16.06
Java #4 4.41 105,000 667 16.14
Java #6 4.19 82,232 808 16.42
Java 24.50 42,272 671 24.57
Java #3 6.96 82,972 910 27.54
Java #8 27.67 45,844 441 27.79
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
Java #4 3.28 44,352 1528 3.40
Java #6 1.16 49,848 2549 3.71
Java #5 1.24 49,640 2478 4.13
Java #2 4.45 48,896 1259 4.60
* Node.js #5 2.52 112,392 2050 7.08
Java #8 15.11 77,032 894 15.49
Node.js #8 18.42 61,784 742 18.61
Node.js 38.40 58,880 815 38.77
k-nucleotide
source secs mem gz cpu secs
Java 4.92 427,448 1821 15.77
Java #6 7.27 426,032 1614 25.17
Java #3 7.34 426,540 1642 25.47
Java #4 34.33 197,748 1887 34.67
Node.js #3 16.48 436,784 1817 44.54
Java #5 22.10 222,396 2225 48.14
Java #8 78.46 2,083,000 786 80.86
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
Java #6 3.15 2,032,996 760 3.79
Java #5 4.72 1,097,732 1115 4.84
Java #4 5.65 1,891,656 656 5.77
Java #7 23.98 1,037,708 1654 6.26
* Node.js #2 15.44 731,804 1228 16.09
* Node.js #7   Bad Output  
Java #3   Bad Output  
binary-trees
source secs mem gz cpu secs
Java #4 4.41 1,821,244 846 5.14
Java #6 4.87 1,782,568 535 5.63
Java #3 4.85 1,769,500 546 5.65
Java #2 5.09 1,820,068 558 5.83
Java #8 6.57 1,767,108 596 7.29
Java #7 2.62 1,803,192 841 8.14
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
pidigits
source secs mem gz cpu secs
* Java #3 0.80 41,900 770 0.83
Node.js #4 1.11 59,620 487 1.14
* Java #2 1.29 45,768 944 1.37
Java 7.68 482,056 807 8.75
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
Java #2 1.55 372,764 2201 3.16
Node.js #3 4.27 796,080 675 5.30
Node.js #4 5.41 978,952 471 5.56
Java 8.47 575,552 875 16.69
Java #6 5.60 1,237,440 746 17.12
Java #3 5.25 611,476 935 17.25
Java

java 23 2024-09-17
Java HotSpot(TM) 64-Bit Server VM
(build 23+37-2369,
mixed mode, sharing)

Node.js

v23.0.0