The Computer Language
Benchmarks Game

Go programs versus C++ g++

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Go 0.54 132,404 1338 0.91 25% 28% 58% 60%
C++ g++ 0.64 247,800 2280 1.03 89% 22% 31% 30%
pidigits
source secs mem gz cpu cpu load
Go 2.03 9,428 603 2.03 0% 0% 0% 100%
C++ g++ 1.88 4,276 513 1.88 0% 100% 1% 0%
fannkuch-redux
source secs mem gz cpu cpu load
Go 14.44 1,560 900 57.53 100% 100% 100% 100%
C++ g++ 10.61 2,044 980 41.90 100% 96% 100% 100%
fasta
source secs mem gz cpu cpu load
Go 2.17 3,404 1358 5.83 58% 69% 66% 77%
C++ g++ 1.49 4,372 2324 5.28 89% 88% 90% 90%
k-nucleotide
source secs mem gz cpu cpu load
Go 14.98 147,704 1722 55.60 97% 88% 92% 95%
C++ g++ 7.75 165,180 1276 26.02 80% 96% 82% 79%
spectral-norm
source secs mem gz cpu cpu load
Go 3.94 2,320 548 15.69 99% 100% 100% 99%
C++ g++ 2.02 1,332 1044 7.91 99% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Go 21.47 1,568 1200 21.47 78% 1% 1% 22%
C++ g++ 8.23 1,856 1763 8.23 100% 1% 1% 0%
mandelbrot
source secs mem gz cpu cpu load
Go 5.48 30,704 905 21.74 100% 100% 99% 100%
C++ g++ 1.64 27,636 1002 6.51 100% 99% 100% 99%
binary-trees
source secs mem gz cpu cpu load
Go 34.42 268,188 654 130.26 96% 94% 95% 94%
C++ g++ 2.55 135,568 809 7.99 85% 96% 69% 66%
regex-redux
source secs mem gz cpu cpu load
Go 28.49 318,144 802 59.96 74% 48% 41% 48%
C++ g++ 1.61 203,572 1315 4.18 100% 52% 57% 54%
Go

go version go1.9 linux/amd64

C++ g++

g++ (Ubuntu 7.2.0-8ubuntu3) 7.2.0