The Computer Language
Benchmarks Game

Go versus Java fastest programs

by faster benchmark performance

pidigits
source secs mem gz cpu cpu load
Go 2.04 8,976 603 2.04 1% 0% 100% 0%
Java 3.14 37,080 938 3.35 4% 4% 1% 98%
mandelbrot
source secs mem gz cpu cpu load
Go 5.47 31,280 905 21.73 99% 99% 99% 100%
Java 6.13 76,876 796 23.60 96% 96% 96% 97%
spectral-norm
source secs mem gz cpu cpu load
Go 3.95 2,412 548 15.70 100% 99% 99% 99%
Java 4.41 35,028 950 16.79 96% 97% 98% 95%
fasta
source secs mem gz cpu cpu load
Go 2.07 3,168 1358 5.87 39% 83% 84% 79%
Java 2.29 43,724 2473 6.16 67% 76% 59% 70%
n-body
source secs mem gz cpu cpu load
Go 21.00 1,532 1200 21.00 1% 0% 0% 100%
Java 22.19 33,272 1489 22.28 35% 2% 66% 1%
fannkuch-redux
source secs mem gz cpu cpu load
Go 17.82 1,472 900 71.03 100% 100% 100% 100%
Java 17.74 31,900 1282 69.78 99% 98% 99% 98%
reverse-complement
source secs mem gz cpu cpu load
Go 4.00 824,412 611 4.15 86% 14% 5% 1%
Java 3.18 672,272 2183 7.17 67% 46% 43% 77%
k-nucleotide
source secs mem gz cpu cpu load
Go 15.36 148,056 1722 54.61 77% 96% 95% 88%
Java 8.66 384,756 1812 26.91 69% 88% 81% 75%
regex-redux
source secs mem gz cpu cpu load
Go 28.69 407,444 802 60.43 46% 51% 68% 46%
Java 10.43 609,920 929 31.73 72% 78% 72% 83%
binary-trees
source secs mem gz cpu cpu load
Go 28.90 471,068 654 110.50 96% 95% 95% 97%
Java 8.37 894,000 835 27.85 77% 85% 97% 77%
Go

go version go1.11 linux/amd64

Java

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)