The Computer Language
Benchmarks Game

Java programs versus Go

by benchmark task performance

binary-trees
source secs mem gz cpu cpu load
Java 11.52 643,924 889 40.54 89% 92% 85% 89%
Go 39.68 364,612 688 150.64 95% 95% 95% 96%
k-nucleotide
source secs mem gz cpu cpu load
Java 8.02 467,004 1802 25.57 76% 98% 73% 74%
Go 17.36 149,280 1582 64.05 87% 91% 95% 97%
n-body
source secs mem gz cpu cpu load
Java 21.50 27,240 1489 21.52 1% 1% 100% 0%
Go 21.52 832 1310 21.52 1% 1% 1% 100%
mandelbrot
source secs mem gz cpu cpu load
Java 5.89 89,504 796 23.08 98% 98% 98% 99%
Go 5.64 31,052 894 22.41 99% 99% 99% 100%
fasta
source secs mem gz cpu cpu load
Java 2.14 36,192 2457 5.68 71% 58% 62% 77%
Go 1.98 3,312 1344 5.63 60% 71% 78% 78%
spectral-norm
source secs mem gz cpu cpu load
Java 4.29 31,428 950 16.56 97% 96% 98% 97%
Go 3.95 2,156 548 15.70 100% 99% 99% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Java 17.74 30,048 1282 69.90 98% 98% 100% 99%
Go 15.84 1,384 900 63.01 99% 100% 100% 100%
regex-dna
source secs mem gz cpu cpu load
Java 4.26 667,416 1085 11.69 59% 69% 90% 59%
Go 3.28 336,736 1229 7.27 63% 53% 47% 61%
pidigits
source secs mem gz cpu cpu load
Java 3.06 31,088 938 3.16 0% 3% 9% 92%
Go 2.04 10,560 603 2.03 11% 10% 100% 1%
reverse-complement
source secs mem gz cpu cpu load
Java 1.11 345,308 1661 2.44 33% 58% 54% 80%
Go 0.48 88,820 1278 0.86 32% 48% 63% 44%
Java

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Go

go version go1.8 linux/amd64