The Computer Language
Benchmarks Game

Go versus C gcc fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? Look at the other programs. They may seem more-like a fair comparison to you.

fannkuch-redux
source secs mem gz busy cpu load
Go 7.59 2,064 969 30.31 100% 100% 100% 100%
C gcc 7.52 836 910 29.37 99% 100% 93% 99%
pidigits
source secs mem gz busy cpu load
Go 1.00 8,952 683 1.04 0% 3% 99% 2%
C gcc 0.73 2,848 416 0.75 1% 100% 1% 0%
fasta
source secs mem gz busy cpu load
Go 1.28 11,276 1404 3.78 65% 86% 81% 65%
C gcc 0.78 1,220 1463 0.79 1% 0% 0% 100%
reverse-complement
source secs mem gz busy cpu load
Go 1.42 1,344,600 1338 2.66 57% 36% 71% 24%
C gcc 0.86 698,264 820 1.27 1% 18% 100% 28%
k-nucleotide
source secs mem gz busy cpu load
Go 8.30 160,300 1607 31.96 96% 98% 96% 95%
C gcc 3.81 130,112 1506 12.18 54% 87% 79% 100%
n-body
source secs mem gz busy cpu load
Go 6.38 1,896 1200 6.43 0% 100% 1% 0%
C gcc 2.18 740 1633 2.19 0% 0% 0% 100%
mandelbrot
source secs mem gz busy cpu load
Go 3.75 34,832 894 14.92 100% 99% 99% 100%
C gcc 1.27 31,692 1135 5.08 100% 100% 100% 99%
spectral-norm
source secs mem gz busy cpu load
Go 1.44 2,356 548 5.71 99% 99% 99% 99%
C gcc 0.40 1,928 1197 1.57 100% 98% 100% 98%
regex-redux
source secs mem gz busy cpu load
Go 3.94 323,252 810 6.14 74% 30% 19% 33%
C gcc 0.80 152,196 1397 2.03 48% 100% 54% 53%
binary-trees
source secs mem gz busy cpu load
Go 12.80 385,036 1017 43.87 85% 87% 85% 86%
C gcc 1.79 168,760 809 5.35 64% 64% 71% 100%
Go

go version go1.16 linux/amd64

C gcc

gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0