The Computer Language
Benchmarks Game

Node js versus Java fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

regex-redux
source secs mem gz busy cpu load
Node js 4.27 1,064,544 668 5.47 4% 2% 75% 47%
Java 5.75 647,984 929 18.61 82% 88% 77% 77%
mandelbrot
source secs mem gz busy cpu load
Node js 4.01 86,468 1122 15.74 98% 98% 99% 98%
Java 4.14 71,012 796 16.29 99% 99% 98% 98%
spectral-norm
source secs mem gz busy cpu load
Node js 1.68 62,068 999 6.05 89% 90% 91% 90%
Java 1.57 39,376 756 5.94 96% 94% 95% 95%
fannkuch-redux
source secs mem gz busy cpu load
Node js 12.10 57,164 1313 47.74 98% 98% 99% 99%
Java 10.61 34,960 1282 42.06 99% 99% 99% 98%
n-body
source secs mem gz busy cpu load
Node js 8.35 35,628 1268 8.48 1% 100% 0% 0%
Java 6.74 36,480 1489 6.84 100% 1% 0% 0%
reverse-complement
source secs mem gz busy cpu load
Node js 2.19 1,340,520 1480 4.46 48% 55% 50% 50%
Java 1.58 677,584 2183 3.76 55% 74% 48% 61%
pidigits
source secs mem gz busy cpu load
Node js 1.32 36,176 599 1.50 3% 2% 8% 100%
Java 0.94 36,644 764 1.07 98% 5% 2% 9%
fasta
source secs mem gz busy cpu load
Node js 2.04 67,420 2047 6.33 76% 85% 75% 74%
Java 1.27 45,584 2473 3.91 82% 83% 73% 70%
binary-trees
source secs mem gz busy cpu load
Node js 5.83 1,204,544 711 19.61 86% 82% 84% 85%
Java 2.48 2,496,112 835 7.88 78% 91% 74% 75%
k-nucleotide
source secs mem gz busy cpu load
Node js 15.06 398,672 1812 41.57 76% 60% 48% 92%
Java 4.57 485,000 1812 14.50 77% 74% 83% 82%
Node js

v14.4.0

Java

java 14.0.1 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)