The Computer Language
Benchmarks Game

Go versus C++ g++ fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

reverse-complement
source secs mem gz busy cpu load
Go 3.83 1,782,940 1338 6.67 21% 74% 16% 62%
C++ g++ 4.72 500,116 840 4.76 100% 0% 0% 0%
pidigits
source secs mem gz busy cpu load
Go 2.10 8,448 603 2.17 1% 48% 55% 0%
C++ g++ 1.89 4,460 513 1.95 2% 0% 100% 1%
fannkuch-redux
source secs mem gz busy cpu load
Go 14.79 1,532 969 58.94 100% 100% 100% 100%
C++ g++ 10.70 1,864 980 42.31 96% 100% 100% 100%
fasta
source secs mem gz busy cpu load
Go 2.08 3,560 1358 5.61 80% 37% 76% 78%
C++ g++ 1.46 2,180 2711 4.39 75% 75% 75% 75%
spectral-norm
source secs mem gz busy cpu load
Go 3.96 2,752 548 15.74 99% 99% 99% 99%
C++ g++ 1.98 2,320 1044 7.90 99% 100% 99% 100%
n-body
source secs mem gz busy cpu load
Go 21.25 1,588 1310 21.82 2% 0% 100% 1%
C++ g++ 7.70 1,772 1879 8.02 4% 0% 0% 100%
k-nucleotide
source secs mem gz busy cpu load
Go 11.77 160,184 1607 44.52 94% 98% 94% 92%
C++ g++ 3.89 156,148 1631 11.99 94% 74% 70% 71%
mandelbrot
source secs mem gz busy cpu load
Go 5.47 31,088 905 21.77 100% 99% 99% 99%
C++ g++ 1.51 25,708 1791 6.01 99% 99% 99% 100%
regex-redux
source secs mem gz busy cpu load
Go 6.84 340,376 810 9.43 30% 43% 13% 52%
C++ g++ 1.85 203,748 1315 4.44 48% 100% 43% 48%
binary-trees
source secs mem gz busy cpu load
Go 26.46 572,836 1007 89.76 86% 84% 85% 85%
C++ g++ 3.93 113,768 809 12.78 70% 81% 75% 98%
Go

go version go1.13 linux/amd64

C++ g++

g++ (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008