The Computer Language
Benchmarks Game

Java programs versus Go

by benchmark task performance

binary-trees
source secs mem gz cpu cpu load
Java 8.39 933,808 835 28.28 82% 86% 84% 88%
Go 28.80 434,632 654 109.58 94% 95% 95% 97%
regex-redux
source secs mem gz cpu cpu load
Java 10.51 573,972 929 31.30 70% 73% 70% 86%
Go 28.21 323,820 802 59.87 69% 46% 50% 48%
k-nucleotide
source secs mem gz cpu cpu load
Java 8.75 385,056 1812 27.09 85% 72% 70% 85%
Go 12.77 148,052 1722 47.35 87% 97% 94% 95%
reverse-complement
source secs mem gz cpu cpu load
Java 3.15 680,424 2183 7.07 52% 70% 43% 63%
Go 4.00 824,356 611 4.16 1% 35% 68% 2%
n-body
source secs mem gz cpu cpu load
Java 22.17 33,040 1489 22.27 100% 1% 0% 1%
Go 21.37 1,536 1310 21.38 0% 0% 100% 0%
fasta
source secs mem gz cpu cpu load
Java 2.27 43,628 2473 5.93 51% 75% 57% 81%
Go 2.08 3,640 1358 5.69 84% 66% 70% 56%
spectral-norm
source secs mem gz cpu cpu load
Java 4.38 35,388 950 16.80 96% 96% 95% 97%
Go 3.94 2,344 548 15.71 100% 100% 100% 100%
mandelbrot
source secs mem gz cpu cpu load
Java 6.10 76,520 796 23.59 97% 98% 98% 96%
Go 5.48 30,912 905 21.79 99% 99% 99% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Java 18.27 31,820 1282 72.06 99% 99% 98% 98%
Go 14.72 1,540 900 58.65 100% 100% 99% 100%
pidigits
source secs mem gz cpu cpu load
Java 3.13 36,984 938 3.36 4% 4% 99% 3%
Go 2.02 9,256 603 2.02 0% 0% 100% 0%
Java

java 10 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

Go

go version go1.10 linux/amd64