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.63 89,120 1338 1.00 39% 43% 27% 57%
C++ g++ 0.64 247,800 2280 1.03 89% 22% 31% 30%
pidigits
source secs mem gz cpu cpu load
Go 2.02 9,256 603 2.02 0% 0% 100% 0%
C++ g++ 1.88 4,276 513 1.88 0% 100% 1% 0%
fannkuch-redux
source secs mem gz cpu cpu load
Go 14.72 1,540 900 58.65 100% 100% 99% 100%
C++ g++ 10.61 2,044 980 41.90 100% 96% 100% 100%
fasta
source secs mem gz cpu cpu load
Go 2.08 3,640 1358 5.69 84% 66% 70% 56%
C++ g++ 1.35 1,952 2711 4.18 79% 78% 78% 79%
k-nucleotide
source secs mem gz cpu cpu load
Go 12.72 148,012 1722 47.51 93% 96% 92% 92%
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,344 548 15.71 100% 100% 100% 100%
C++ g++ 2.02 1,332 1044 7.91 99% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Go 21.37 1,536 1310 21.38 0% 0% 100% 0%
C++ g++ 8.23 1,856 1763 8.23 100% 1% 1% 0%
mandelbrot
source secs mem gz cpu cpu load
Go 5.47 30,664 894 21.75 99% 99% 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 28.80 434,632 654 109.58 94% 95% 95% 97%
C++ g++ 2.55 135,568 809 7.99 85% 96% 69% 66%
regex-redux
source secs mem gz cpu cpu load
Go 28.21 323,820 802 59.87 69% 46% 50% 48%
C++ g++ 1.61 203,572 1315 4.18 100% 52% 57% 54%
Go

go version go1.10 linux/amd64

C++ g++

g++ (Ubuntu 7.2.0-8ubuntu3) 7.2.0