The Computer Language
Benchmarks Game

C gcc programs versus C++ g++

by benchmark task performance

binary-trees
source secs KB gz cpu cpu load
C gcc 3.26 156,840 906 10.12 59% 76% 78% 99%
C++ g++ 6.98 150,564 846 6.97 100% 1% 0% 1%
regex-dna
source secs KB gz cpu cpu load
C gcc 2.46 336,804 2579 5.81 74% 46% 70% 51%
C++ g++ 3.90 245,132 695 6.50 100% 1% 67% 1%
fannkuch-redux
source secs KB gz cpu cpu load
C gcc 8.97 1,588 910 35.14 99% 95% 100% 99%
C++ g++ 13.16 2,100 1439 51.47 99% 100% 94% 99%
pidigits
source secs KB gz cpu cpu load
C gcc 1.73 1,992 448 1.73 2% 6% 1% 100%
C++ g++ 2.29 3,984 682 2.29 0% 1% 100% 1%
reverse-complement
source secs KB gz cpu cpu load
C gcc 0.53 251,672 741 0.77 50% 2% 81% 21%
C++ g++ 0.59 219,048 2275 0.89 83% 21% 53% 5%
fasta
source secs KB gz cpu cpu load
C gcc 1.36 8,180 1993 5.26 97% 96% 100% 97%
C++ g++ 1.49 9,488 2313 5.16 87% 86% 87% 88%
fasta-redux
source secs KB gz cpu cpu load
C gcc 1.55 796 1321 1.55 0% 1% 1% 99%
C++ g++ 1.66 1,620 1474 1.65 0% 100% 1% 2%
spectral-norm
source secs KB gz cpu cpu load
C gcc 1.98 1,868 569 7.88 100% 100% 99% 99%
C++ g++ 2.01 1,828 1044 7.96 100% 100% 100% 100%
mandelbrot
source secs KB gz cpu cpu load
C gcc 5.92 32,904 694 22.77 100% 95% 95% 95%
C++ g++ 5.82 35,860 726 22.38 100% 95% 96% 95%
n-body
source secs KB gz cpu cpu load
C gcc 9.56 1,008 1490 9.56 1% 100% 0% 1%
C++ g++ 9.27 1,752 1763 9.26 0% 100% 1% 0%
k-nucleotide
source secs KB gz cpu cpu load
  No program contribute your program
C++ g++ 0.43 25,844 1252 0.69 30% 44% 76% 29%
C gcc

gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413

C++ g++

gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)