The Computer Language
Benchmarks Game

Go programs versus Java

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Go 0.63 89,120 1338 1.00 39% 43% 27% 57%
Java 1.03 191,064 2183 2.31 52% 57% 43% 74%
pidigits
source secs mem gz cpu cpu load
Go 2.02 9,256 603 2.02 0% 0% 100% 0%
Java 3.12 36,788 938 3.31 6% 3% 4% 96%
fannkuch-redux
source secs mem gz cpu cpu load
Go 14.72 1,540 900 58.65 100% 100% 99% 100%
Java 17.26 32,116 1282 67.75 98% 99% 97% 99%
fasta
source secs mem gz cpu cpu load
Go 2.08 3,640 1358 5.69 84% 66% 70% 56%
Java 2.33 43,924 2473 6.07 53% 71% 63% 74%
mandelbrot
source secs mem gz cpu cpu load
Go 5.47 30,664 894 21.75 99% 99% 99% 100%
Java 6.04 76,528 796 23.34 98% 97% 97% 97%
spectral-norm
source secs mem gz cpu cpu load
Go 3.94 2,344 548 15.71 100% 100% 100% 100%
Java 4.23 34,472 950 16.27 96% 97% 97% 96%
n-body
source secs mem gz cpu cpu load
Go 21.37 1,536 1310 21.38 0% 0% 100% 0%
Java 22.10 33,136 1429 22.20 31% 1% 1% 70%
k-nucleotide
source secs mem gz cpu cpu load
Go 12.72 148,012 1722 47.51 93% 96% 92% 92%
Java 8.70 375,568 1812 27.17 80% 72% 74% 88%
regex-redux
source secs mem gz cpu cpu load
Go 28.21 323,820 802 59.87 69% 46% 50% 48%
Java 10.34 627,224 929 29.88 74% 72% 65% 79%
binary-trees
source secs mem gz cpu cpu load
Go 28.80 434,632 654 109.58 94% 95% 95% 97%
Java 8.34 893,008 835 28.20 87% 79% 96% 81%
Go

go version go1.10 linux/amd64

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)