The Computer Language
Benchmarks Game

Java programs versus Go

by benchmark task performance

binary-trees
source secs mem gz cpu cpu load
Java 8.34 893,008 835 28.20 87% 79% 96% 81%
Go 34.42 268,188 654 130.26 96% 94% 95% 94%
regex-redux
source secs mem gz cpu cpu load
Java 10.34 627,224 929 29.88 74% 72% 65% 79%
Go 28.49 318,144 802 59.96 74% 48% 41% 48%
k-nucleotide
source secs mem gz cpu cpu load
Java 8.70 375,568 1812 27.17 80% 72% 74% 88%
Go 14.98 147,704 1722 55.60 97% 88% 92% 95%
n-body
source secs mem gz cpu cpu load
Java 22.10 33,136 1429 22.20 31% 1% 1% 70%
Go 21.47 1,568 1200 21.47 78% 1% 1% 22%
spectral-norm
source secs mem gz cpu cpu load
Java 4.23 34,472 950 16.27 96% 97% 97% 96%
Go 3.94 2,320 548 15.69 99% 100% 100% 99%
fasta
source secs mem gz cpu cpu load
Java 2.33 43,924 2473 6.07 53% 71% 63% 74%
Go 2.17 3,404 1358 5.83 58% 69% 66% 77%
mandelbrot
source secs mem gz cpu cpu load
Java 6.04 76,528 796 23.34 98% 97% 97% 97%
Go 5.48 30,704 905 21.74 100% 100% 99% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Java 17.26 32,116 1282 67.75 98% 99% 97% 99%
Go 14.44 1,560 900 57.53 100% 100% 100% 100%
pidigits
source secs mem gz cpu cpu load
Java 3.12 36,788 938 3.31 6% 3% 4% 96%
Go 2.03 9,428 603 2.03 0% 0% 0% 100%
reverse-complement
source secs mem gz cpu cpu load
Java 1.03 191,064 2183 2.31 52% 57% 43% 74%
Go 0.54 132,404 1338 0.91 25% 28% 58% 60%
Java

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

Go

go version go1.9 linux/amd64