The Computer Language
Benchmarks Game

Go versus Java fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? 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.94 323,252 810 6.14 74% 30% 19% 33%
Java 5.58 985,696 929 18.26 81% 77% 84% 85%
fannkuch-redux
source secs mem gz busy cpu load
Go 7.59 2,064 969 30.31 100% 100% 100% 100%
Java 10.64 35,192 1282 41.91 99% 98% 99% 97%
spectral-norm
source secs mem gz busy cpu load
Go 1.44 2,356 548 5.71 99% 99% 99% 99%
Java 1.63 39,304 756 6.22 95% 97% 95% 95%
mandelbrot
source secs mem gz busy cpu load
Go 3.75 34,832 894 14.92 100% 99% 99% 100%
Java 4.15 69,136 796 16.29 98% 99% 98% 99%
reverse-complement
source secs mem gz busy cpu load
Go 1.42 1,344,600 1338 2.66 57% 36% 71% 24%
Java 1.54 670,924 2183 3.51 46% 56% 48% 79%
n-body
source secs mem gz busy cpu load
Go 6.38 1,896 1200 6.43 0% 100% 1% 0%
Java 6.74 35,844 1489 6.82 1% 100% 1% 0%
fasta
source secs mem gz busy cpu load
Go 1.28 11,276 1404 3.78 65% 86% 81% 65%
Java 1.21 44,620 2543 3.58 89% 75% 65% 68%
pidigits
source secs mem gz busy cpu load
Go 1.00 8,952 683 1.04 0% 3% 99% 2%
Java 0.93 36,552 764 0.98 2% 3% 1% 99%
k-nucleotide
source secs mem gz busy cpu load
Go 8.30 160,300 1607 31.96 96% 98% 96% 95%
Java 4.98 356,904 1812 16.25 78% 76% 96% 76%
binary-trees
source secs mem gz busy cpu load
Go 6.73 299,572 701 26.34 98% 97% 98% 98%
Java 2.48 1,722,848 835 7.88 98% 75% 71% 74%
Go

go version go1.16 linux/amd64

Java

openjdk 16 2021-03-16
OpenJDK Runtime Environment (build 16+36-2231)
OpenJDK 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)