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.48 88,820 1278 0.86 32% 48% 63% 44%
C++ g++ 0.59 217,564 2275 0.84 26% 78% 12% 34%
mandelbrot
source secs mem gz cpu cpu load
Go 5.64 31,052 894 22.41 99% 99% 99% 100%
C++ g++ 5.82 33,952 726 22.40 96% 95% 95% 100%
pidigits
source secs mem gz cpu cpu load
Go 2.04 10,560 603 2.03 11% 10% 100% 1%
C++ g++ 1.89 3,740 508 1.89 2% 99% 0% 2%
fasta
source secs mem gz cpu cpu load
Go 1.98 3,312 1344 5.63 60% 71% 78% 78%
C++ g++ 1.47 9,484 2291 5.13 88% 88% 87% 88%
fannkuch-redux
source secs mem gz cpu cpu load
Go 15.84 1,384 900 63.01 99% 100% 100% 100%
C++ g++ 10.39 2,592 980 40.76 95% 99% 98% 100%
spectral-norm
source secs mem gz cpu cpu load
Go 3.95 2,156 548 15.70 100% 99% 99% 100%
C++ g++ 2.01 1,792 1044 8.00 100% 100% 100% 100%
k-nucleotide
source secs mem gz cpu cpu load
Go 15.02 149,248 1713 56.88 92% 94% 97% 96%
C++ g++ 7.15 164,080 1252 24.21 82% 83% 80% 96%
n-body
source secs mem gz cpu cpu load
Go 21.52 832 1310 21.52 1% 1% 1% 100%
C++ g++ 9.30 1,712 1763 9.29 100% 1% 1% 0%
regex-redux
source secs mem gz cpu cpu load
Go 29.76 353,332 798 62.56 50% 67% 53% 41%
C++ g++ 6.75 183,256 700 9.80 100% 39% 8% 0%
binary-trees
source secs mem gz cpu cpu load
Go 39.68 364,612 688 150.64 95% 95% 95% 96%
C++ g++ 3.36 158,320 846 10.59 81% 82% 78% 75%
Go

go version go1.8 linux/amd64

C++ g++

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609