The Computer Language
Benchmarks Game

Go versus Java fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

regex-redux
source secs mem gz busy cpu load
Go 3.57 382,828 810 5.71 21% 42% 47% 51%
Java 5.75 647,984 929 18.61 82% 88% 77% 77%
fannkuch-redux
source secs mem gz busy cpu load
Go 8.51 2,732 969 34.00 100% 100% 100% 100%
Java 10.61 34,960 1282 42.06 99% 99% 99% 98%
reverse-complement
source secs mem gz busy cpu load
Go 1.38 1,465,376 1338 2.54 51% 47% 38% 50%
Java 1.58 677,584 2183 3.76 55% 74% 48% 61%
mandelbrot
source secs mem gz busy cpu load
Go 3.73 28,764 905 14.88 100% 99% 99% 100%
Java 4.14 71,012 796 16.29 99% 99% 98% 98%
spectral-norm
source secs mem gz busy cpu load
Go 1.43 2,668 548 5.70 99% 99% 99% 100%
Java 1.57 39,376 756 5.94 96% 94% 95% 95%
n-body
source secs mem gz busy cpu load
Go 6.34 1,792 1200 6.44 1% 100% 0% 0%
Java 6.74 36,480 1489 6.84 100% 1% 0% 0%
fasta
source secs mem gz busy cpu load
Go 1.20 11,452 1404 3.62 73% 70% 84% 74%
Java 1.27 45,584 2473 3.91 82% 83% 73% 70%
pidigits
source secs mem gz busy cpu load
Go 1.23 8,580 603 1.26 1% 50% 2% 50%
Java 0.94 36,644 764 1.07 98% 5% 2% 9%
k-nucleotide
source secs mem gz busy cpu load
Go 8.03 150,544 1722 30.53 97% 96% 95% 92%
Java 4.57 485,000 1812 14.50 77% 74% 83% 82%
binary-trees
source secs mem gz busy cpu load
Go 12.36 396,032 1007 43.05 88% 86% 89% 85%
Java 2.48 2,496,112 835 7.88 78% 91% 74% 75%
Go

go version go1.14.4 linux/amd64

Java

java 14.0.1 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)