The Computer Language
Benchmarks Game

C gcc programs versus C++ g++

by benchmark task performance

fasta
secs KB gz cpu cpu load
C gcc 2.83 704 1261 2.82 2% 2% 100% 100%
C++ g++ 4.18 1,348 1105 4.18 0% 100% 1% 100%
reverse-complement
secs KB gz cpu cpu load
C gcc 0.76 251,292 741 0.76 1% 100% 0% 100%
C++ g++ 1.02 247,360 2275 1.01 1% 100% 1% 99%
fasta-redux
secs KB gz cpu cpu load
C gcc 1.58 572 1402 1.58 1% 100% 1% 100%
C++ g++ 2.06 1,336 1474 2.06 1% 100% 0% 100%
regex-dna
secs KB gz cpu cpu load
C gcc 5.46 288,880 2579 5.45 2% 100% 0% 100%
C++ g++ 6.99 215,316 695 6.98 0% 1% 1% 100%
binary-trees
secs KB gz cpu cpu load
C gcc 9.64 100,732 906 9.63 1% 0% 1% 100%
C++ g++ 11.34 150,824 892 11.33 0% 1% 0% 100%
pidigits
secs KB gz cpu cpu load
C gcc 2.50 2,120 448 2.49 1% 1% 100% 100%
C++ g++ 2.68 3,500 682 2.68 1% 100% 0% 100%
fannkuch-redux
secs KB gz cpu cpu load
C gcc 24.20 708 1183 24.19 1% 91% 10% 100%
C++ g++ 24.65 628 1150 24.64 1% 100% 1% 100%
spectral-norm
secs KB gz cpu cpu load
C gcc 7.85 1,612 569 7.85 1% 1% 100% 100%
C++ g++ 7.93 2,324 1044 7.92 1% 100% 0% 100%
n-body
secs KB gz cpu cpu load
C gcc 9.94 736 1490 9.94 1% 100% 1% 100%
C++ g++ 8.95 800 1545 8.95 1% 0% 100% 100%
mandelbrot
secs KB gz cpu cpu load
C gcc 22.37 31,976 799 22.36 1% 0% 100% 100%
C++ g++ 20.11 33,716 726 20.10 1% 96% 4% 100%
k-nucleotide
secs KB gz cpu cpu load
C gcc 34.26 127,908 1535 34.24 1% 1% 100% 100%
C++ g++ 24.11 138,888 1252 24.09 1% 1% 100% 100%
C gcc

gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010

C++ g++

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