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.49 133,532 1278 0.87 76% 30% 27% 49%
C++ g++ 0.60 211,852 2275 0.98 38% 25% 82% 27%
pidigits
source secs mem gz cpu cpu load
Go 2.02 10,744 603 2.02 2% 0% 5% 96%
C++ g++ 1.89 3,868 508 1.89 100% 1% 2% 1%
fannkuch-redux
source secs mem gz cpu cpu load
Go 14.49 3,204 896 57.82 100% 100% 100% 100%
C++ g++ 10.35 2,624 980 40.60 99% 99% 100% 95%
fasta
source secs mem gz cpu cpu load
Go 2.17 3,584 1344 5.84 59% 78% 70% 64%
C++ g++ 1.48 4,176 2313 5.25 89% 90% 88% 89%
regex-redux
source secs mem gz cpu cpu load
Go 29.29 344,348 798 61.79 37% 59% 79% 38%
C++ g++ 17.14 220,088 853 25.22 95% 3% 51% 1%
spectral-norm
source secs mem gz cpu cpu load
Go 3.96 2,584 548 15.70 99% 99% 99% 99%
C++ g++ 1.99 1,880 1044 7.89 100% 99% 99% 99%
k-nucleotide
source secs mem gz cpu cpu load
Go 14.79 149,212 1713 53.03 88% 90% 96% 87%
C++ g++ 7.18 164,052 1252 24.28 83% 83% 93% 83%
n-body
source secs mem gz cpu cpu load
Go 21.47 1,560 1200 21.47 100% 0% 1% 1%
C++ g++ 9.31 1,052 1544 9.30 1% 1% 1% 100%
mandelbrot
source secs mem gz cpu cpu load
Go 5.46 31,172 905 21.66 99% 100% 100% 99%
C++ g++ 1.73 34,064 1002 6.80 98% 98% 98% 99%
binary-trees
source secs mem gz cpu cpu load
Go 35.18 277,864 660 132.94 96% 94% 94% 95%
C++ g++ 2.36 114,404 809 7.69 86% 71% 87% 85%
Go

go version go1.9 linux/amd64

C++ g++

g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406