The Computer Language
Benchmarks Game

Go programs versus Java

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Go 0.49 88,056 1278 0.87 27% 43% 28% 81%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
pidigits
source secs mem gz cpu cpu load
Go 2.02 8,588 603 2.02 100% 0% 1% 1%
Java 3.06 31,760 938 3.16 6% 3% 97% 1%
mandelbrot
source secs mem gz cpu cpu load
Go 5.64 31,312 894 22.41 99% 100% 99% 99%
Java 7.10 90,588 796 27.92 99% 99% 98% 98%
spectral-norm
source secs mem gz cpu cpu load
Go 3.96 2,148 548 15.71 100% 99% 99% 99%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
fasta
source secs mem gz cpu cpu load
Go 1.98 3,044 1344 5.65 75% 82% 47% 85%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
n-body
source secs mem gz cpu cpu load
Go 21.52 832 1310 21.52 1% 100% 0% 0%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
fannkuch-redux
source secs mem gz cpu cpu load
Go 15.81 1,372 900 62.92 100% 100% 99% 99%
Java 13.74 30,368 1282 54.12 100% 98% 98% 99%
k-nucleotide
source secs mem gz cpu cpu load
Go 16.08 149,180 1582 59.44 95% 90% 90% 97%
Java 7.93 465,372 1802 25.11 75% 75% 75% 93%
regex-redux
source secs mem gz cpu cpu load
Go 29.51 352,804 798 61.51 77% 49% 43% 40%
Java 12.31 902,528 929 38.75 73% 76% 86% 81%
binary-trees
source secs mem gz cpu cpu load
Go 34.77 269,068 654 132.04 95% 97% 95% 95%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
Go

go version go1.8.1 linux/amd64

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)