The Computer Language
Benchmarks Game

C++ g++ programs versus C gcc

by benchmark task performance

k-nucleotide
secs KB gz cpu cpu load
C++ g++ 7.16 157,828 1252 24.08 83% 79% 82% 94%
C gcc 12.17 189,420 2280 36.18 53% 97% 53% 96%
n-body
secs KB gz cpu cpu load
C++ g++ 9.30 1,768 1763 9.30 0% 1% 1% 100%
C gcc 9.56 1,008 1490 9.56 1% 0% 0% 100%
mandelbrot
secs KB gz cpu cpu load
C++ g++ 5.82 33,964 726 22.39 96% 95% 95% 100%
C gcc 5.92 32,464 694 22.81 95% 100% 96% 95%
spectral-norm
secs KB gz cpu cpu load
C++ g++ 2.01 1,772 1044 8.00 100% 100% 100% 100%
C gcc 1.98 1,784 1139 7.87 99% 99% 100% 99%
fasta-redux
secs KB gz cpu cpu load
C++ g++ 1.65 1,636 1474 1.65 1% 100% 1% 0%
C gcc 1.55 732 1321 1.54 1% 100% 0% 1%
reverse-complement
secs KB gz cpu cpu load
C++ g++ 0.58 214,852 2275 0.96 29% 18% 88% 38%
C gcc 0.50 251,028 741 0.76 82% 44% 12% 20%
pidigits
secs KB gz cpu cpu load
C++ g++ 2.29 3,792 682 2.29 1% 100% 1% 1%
C gcc 1.73 1,988 448 1.72 1% 0% 1% 100%
fannkuch-redux
secs KB gz cpu cpu load
C++ g++ 13.12 2,032 1440 51.38 99% 99% 94% 100%
C gcc 9.16 3,624 910 35.83 95% 99% 99% 99%
regex-dna
secs KB gz cpu cpu load
C++ g++ 3.89 210,944 695 6.53 100% 69% 1% 0%
C gcc 2.45 317,952 2579 5.87 53% 51% 48% 92%
fasta
secs KB gz cpu cpu load
C++ g++ 4.18 1,700 1286 4.18 0% 100% 1% 0%
C gcc 1.90 6,020 1914 5.21 90% 3% 87% 97%
binary-trees
secs KB gz cpu cpu load
C++ g++ 7.72 362,628 892 24.49 84% 70% 97% 69%
C gcc 3.24 156,848 906 10.15 85% 62% 78% 92%
C++ g++

g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010

C gcc

gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010