The Computer Language
Benchmarks Game

Java programs versus Go

by benchmark task performance

binary-trees
source secs mem gz cpu cpu load
Java 8.58 966,808 835 28.98 86% 84% 90% 81%
Go 35.18 277,864 660 132.94 96% 94% 94% 95%
regex-redux
source secs mem gz cpu cpu load
Java 10.38 634,548 929 29.48 70% 64% 69% 82%
Go 29.29 344,348 798 61.79 37% 59% 79% 38%
k-nucleotide
source secs mem gz cpu cpu load
Java 8.38 375,988 1802 26.25 73% 97% 70% 74%
Go 14.79 149,212 1713 53.03 88% 90% 96% 87%
fannkuch-redux
source secs mem gz cpu cpu load
Java 15.09 34,764 1282 59.26 99% 98% 98% 100%
Go 14.49 3,204 896 57.82 100% 100% 100% 100%
n-body
source secs mem gz cpu cpu load
Java 22.56 35,208 1424 22.65 99% 1% 1% 1%
Go 21.47 1,560 1200 21.47 100% 0% 1% 1%
fasta
source secs mem gz cpu cpu load
Java 2.32 46,816 2457 6.37 61% 60% 96% 60%
Go 2.17 3,584 1344 5.84 59% 78% 70% 64%
spectral-norm
source secs mem gz cpu cpu load
Java 4.25 36,364 950 16.30 97% 96% 95% 97%
Go 3.96 2,584 548 15.70 99% 99% 99% 99%
mandelbrot
source secs mem gz cpu cpu load
Java 6.08 77,056 796 23.61 97% 97% 99% 97%
Go 5.46 31,172 905 21.66 99% 100% 100% 99%
pidigits
source secs mem gz cpu cpu load
Java 3.12 37,444 938 3.30 2% 5% 98% 4%
Go 2.02 10,744 603 2.02 2% 0% 5% 96%
reverse-complement
source secs mem gz cpu cpu load
Java 1.13 199,672 2124 2.76 48% 74% 70% 54%
Go 0.49 133,532 1278 0.87 76% 30% 27% 49%
Java

java 9
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

Go

go version go1.9 linux/amd64