The Computer Language
Benchmarks Game

Go 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
Go 7.21 326,552 810 10.19 22% 18% 87% 14%
Java 10.27 635,500 740 29.42 74% 81% 55% 76%
mandelbrot
source secs mem gz busy cpu load
Go 5.55 30,300 894 22.11 99% 99% 99% 100%
Java 6.84 76,008 796 26.90 99% 98% 98% 98%
fannkuch-redux
source secs mem gz busy cpu load
Go 14.93 3,484 969 59.67 100% 100% 100% 100%
Java 16.12 33,168 1282 63.71 100% 98% 99% 98%
fasta
source secs mem gz busy cpu load
Go 2.11 4,228 1358 5.66 69% 65% 64% 70%
Java 2.22 43,096 2473 6.10 67% 83% 45% 80%
n-body
source secs mem gz busy cpu load
Go 21.26 1,888 1310 22.28 3% 0% 100% 2%
Java 21.85 34,112 1489 22.16 1% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Go 4.12 2,704 548 15.93 96% 98% 97% 96%
Java 4.15 36,428 950 16.26 98% 100% 98% 97%
pidigits
source secs mem gz busy cpu load
Go 2.04 8,724 603 2.36 20% 32% 33% 31%
Java 1.83 34,848 764 1.95 99% 1% 4% 2%
reverse-complement
source secs mem gz busy cpu load
Go 3.73 826,488 611 4.10 88% 6% 2% 14%
Java 3.27 714,144 2183 7.54 47% 60% 66% 58%
k-nucleotide
source secs mem gz busy cpu load
Go 12.67 150,584 1722 47.44 95% 90% 93% 96%
Java 9.14 403,576 1812 29.10 87% 72% 74% 86%
binary-trees
source secs mem gz busy cpu load
Go 25.19 397,116 1007 86.01 88% 86% 84% 83%
Java 8.28 948,040 835 28.20 80% 84% 87% 90%
Go

go version go1.14 linux/amd64

Java

openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)