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 3.61 374,916 810 5.95 47% 34% 20% 64%
Java 5.70 656,328 929 18.25 89% 76% 79% 75%
fannkuch-redux
source secs mem gz busy cpu load
Go 8.28 2,428 969 33.10 100% 100% 100% 100%
Java 11.00 34,104 1282 43.42 99% 98% 98% 99%
spectral-norm
source secs mem gz busy cpu load
Go 1.43 2,088 548 5.67 99% 99% 99% 99%
Java 1.68 38,348 950 6.43 96% 96% 96% 95%
mandelbrot
source secs mem gz busy cpu load
Go 3.75 34,848 894 14.94 99% 100% 99% 99%
Java 4.11 68,204 796 16.20 98% 99% 98% 99%
reverse-complement
source secs mem gz busy cpu load
Go 1.43 1,467,392 1338 2.67 48% 38% 55% 45%
Java 1.54 702,332 2183 3.55 78% 46% 49% 57%
fasta
source secs mem gz busy cpu load
Go 1.20 11,364 1404 3.67 80% 75% 73% 77%
Java 1.27 43,968 2473 3.92 73% 95% 70% 70%
n-body
source secs mem gz busy cpu load
Go 6.38 1,800 1200 6.44 0% 0% 0% 100%
Java 6.75 35,200 1489 6.83 0% 0% 100% 1%
pidigits
source secs mem gz busy cpu load
Go 0.86 8,980 683 0.88 2% 0% 0% 100%
Java 0.79 35,568 764 0.84 99% 3% 3% 1%
k-nucleotide
source secs mem gz busy cpu load
Go 8.29 160,156 1607 32.00 96% 96% 98% 96%
Java 5.00 408,040 1812 16.36 74% 81% 86% 86%
binary-trees
source secs mem gz busy cpu load
Go 12.65 431,720 1017 43.57 86% 85% 87% 86%
Java 2.50 2,487,096 835 7.90 88% 75% 75% 79%
Go

go version go1.15.2 linux/amd64

Java

openjdk 15 2020-09-15
OpenJDK Runtime Environment (build 15+36-1562)
OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)