The Computer Language
Benchmarks Game

C gcc versus C++ g++ fastest programs

by faster benchmark performance

reverse-complement
source secs mem gz cpu cpu load
C gcc 1.76 994,488 1438 3.98 97% 43% 44% 46%
C++ g++ 2.93 980,716 2280 4.52 51% 23% 33% 51%
regex-redux
source secs mem gz cpu cpu load
C gcc 1.46 152,216 1397 3.40 45% 41% 100% 49%
C++ g++ 1.83 203,520 1315 4.41 50% 45% 100% 49%
fannkuch-redux
source secs mem gz cpu cpu load
C gcc 8.67 852 910 34.14 99% 100% 100% 95%
C++ g++ 10.12 1,852 980 39.95 100% 100% 96% 100%
mandelbrot
source secs mem gz cpu cpu load
C gcc 1.64 26,512 1135 6.54 99% 100% 99% 100%
C++ g++ 1.81 29,072 1002 7.10 98% 98% 98% 100%
pidigits
source secs mem gz cpu cpu load
C gcc 1.75 2,672 452 1.75 100% 2% 2% 0%
C++ g++ 1.89 4,272 513 1.89 1% 3% 100% 2%
n-body
source secs mem gz cpu cpu load
C gcc 9.37 1,088 1490 9.37 100% 0% 1% 0%
C++ g++ 9.42 1,704 1763 9.41 2% 100% 1% 0%
spectral-norm
source secs mem gz cpu cpu load
C gcc 1.98 1,168 1139 7.87 100% 99% 100% 99%
C++ g++ 1.98 1,164 1044 7.87 99% 99% 99% 100%
binary-trees
source secs mem gz cpu cpu load
C gcc 3.73 116,600 836 11.74 76% 71% 98% 72%
C++ g++ 3.68 119,052 809 11.93 98% 76% 77% 78%
fasta
source secs mem gz cpu cpu load
C gcc 1.36 2,864 2268 5.41 99% 100% 100% 99%
C++ g++ 1.33 1,740 2711 4.29 81% 81% 81% 82%
k-nucleotide
source secs mem gz cpu cpu load
C gcc 4.88 130,060 1506 16.06 87% 96% 87% 60%
C++ g++ 3.73 156,080 1624 11.60 75% 70% 72% 96%
C gcc

gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0

C++ g++

g++ (Ubuntu 8.2.0-7ubuntu1) 8.2.0