The Computer Language
Benchmarks Game

C gcc programs versus C++ g++

by benchmark task performance

reverse-complement
source secs KB gz cpu cpu load
C gcc 0.62 125,340 812 0.62 3% 0% 0% 100%
C++ g++ 1.02 247,604 2275 1.01 2% 0% 0% 100%
fasta
source secs KB gz cpu cpu load
C gcc 2.79 640 1261 2.79 1% 1% 0% 100%
C++ g++ 4.21 1,336 1105 4.20 1% 1% 0% 100%
regex-dna
source secs KB gz cpu cpu load
C gcc 5.53 297,880 2579 5.50 2% 1% 1% 100%
C++ g++ 7.07 183,784 648 7.06 6% 1% 0% 100%
fannkuch-redux
source secs KB gz cpu cpu load
C gcc 24.19 636 1183 24.18 1% 1% 0% 100%
C++ g++ 24.65 556 1150 24.64 1% 1% 0% 100%
spectral-norm
source secs KB gz cpu cpu load
C gcc 7.85 1,628 569 7.85 1% 1% 1% 100%
C++ g++ 7.93 2,288 1044 7.92 1% 1% 0% 100%
k-nucleotide
source secs KB gz cpu cpu load
C gcc 23.93 126,832 1500 23.91 0% 1% 1% 100%
C++ g++ 24.04 137,908 1252 23.98 1% 1% 0% 100%
pidigits
source secs KB gz cpu cpu load
C gcc 2.50 1,992 448 2.50 2% 1% 1% 100%
C++ g++ 2.27 3,440 508 2.27 0% 1% 1% 100%
mandelbrot
source secs KB gz cpu cpu load
C gcc 22.37 31,904 694 22.36 1% 1% 1% 100%
C++ g++ 20.11 33,768 726 20.10 0% 1% 1% 100%
n-body
source secs KB gz cpu cpu load
C gcc 10.01 740 1490 10.00 1% 1% 0% 100%
C++ g++ 8.96 816 1545 8.95 1% 1% 0% 100%
binary-trees
source secs KB gz cpu cpu load
C gcc 9.58 100,796 906 9.57 1% 1% 1% 100%
C++ g++ 6.86 76,616 846 6.85 0% 1% 0% 100%
C gcc

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609

C++ g++

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609