The Computer Language
Benchmarks Game

C gcc programs versus C++ g++

by benchmark task performance

fasta
secs KB gz cpu cpu load
C gcc 1.81 2,352 1914 5.29 89% 53% 54% 100%
C++ g++ 4.28 1,168 1105 4.28 1% 1% 1% 100%
binary-trees
secs KB gz cpu cpu load
C gcc 2.97 105,024 906 9.68 93% 77% 87% 72%
C++ g++ 5.08 180,752 892 16.57 81% 85% 82% 83%
regex-dna
secs KB gz cpu cpu load
C gcc 2.67 290,792 2579 6.34 96% 76% 84% 67%
C++ g++ 4.02 176,492 695 5.57 2% 63% 75% 1%
fasta-redux
secs KB gz cpu cpu load
C gcc 1.59 624 1402 1.59 100% 1% 1% 0%
C++ g++ 2.10 1,120 1474 2.10 100% 0% 0% 1%
reverse-complement
secs KB gz cpu cpu load
C gcc 0.60 251,368 741 0.86 95% 84% 44% 15%
C++ g++ 0.78 247,340 2275 1.17 23% 87% 11% 47%
fannkuch-redux
secs KB gz cpu cpu load
C gcc 10.06 1,388 910 39.49 99% 99% 95% 100%
C++ g++ 13.02 1,412 1440 50.93 100% 94% 99% 100%
pidigits
secs KB gz cpu cpu load
C gcc 2.50 2,140 448 2.49 100% 0% 1% 0%
C++ g++ 2.69 3,076 682 2.68 0% 1% 2% 100%
mandelbrot
secs KB gz cpu cpu load
C gcc 5.61 28,988 799 22.40 100% 100% 100% 100%
C++ g++ 5.77 33,592 1017 22.97 99% 99% 99% 100%
spectral-norm
secs KB gz cpu cpu load
C gcc 1.98 1,704 569 7.86 99% 100% 99% 99%
C++ g++ 2.00 2,024 1044 7.96 100% 100% 100% 100%
n-body
secs KB gz cpu cpu load
C gcc 10.39 736 1490 10.38 0% 100% 1% 1%
C++ g++ 9.13 876 1545 9.12 0% 0% 100% 1%
k-nucleotide
secs KB gz cpu cpu load
C gcc 12.35 131,904 1535 36.58 37% 71% 95% 94%
C++ g++ 7.22 132,740 1252 23.60 78% 77% 76% 98%
C gcc

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)

C++ g++

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)