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++ 17.96 153,616 1252 17.94 1% 1% 0% 100%
C gcc 32.04 181,108 2280 32.01 1% 0% 0% 100%
n-body
secs KB gz cpu cpu load
C++ g++ 9.40 1,084 1544 9.39 0% 1% 1% 100%
C gcc 10.50 1,008 1490 10.49 0% 1% 1% 100%
fannkuch-redux
secs KB gz cpu cpu load
C++ g++ 22.63 664 1150 22.62 1% 0% 0% 100%
C gcc 22.63 808 1183 22.62 1% 2% 1% 100%
spectral-norm
secs KB gz cpu cpu load
C++ g++ 7.85 1,688 1278 7.85 0% 0% 1% 100%
C gcc 7.85 1,692 569 7.85 0% 1% 0% 100%
regex-dna
secs KB gz cpu cpu load
C++ g++ 5.25 208,928 648 5.24 1% 1% 0% 100%
C gcc 5.09 323,572 2579 5.08 0% 1% 0% 100%
fasta-redux
secs KB gz cpu cpu load
C++ g++ 1.66 1,460 1474 1.66 4% 1% 0% 100%
C gcc 1.57 680 1321 1.57 1% 0% 1% 100%
reverse-complement
secs KB gz cpu cpu load
C++ g++ 0.78 247,296 2275 0.77 13% 0% 0% 99%
C gcc 0.67 251,684 741 0.66 0% 1% 0% 100%
mandelbrot
secs KB gz cpu cpu load
C++ g++ 24.40 33,812 1017 24.39 0% 0% 1% 100%
C gcc 19.75 32,496 694 19.74 0% 0% 0% 100%
fasta
secs KB gz cpu cpu load
C++ g++ 4.23 1,496 1286 4.22 0% 1% 0% 100%
C gcc 3.29 748 1261 3.29 0% 0% 1% 100%
pidigits
secs KB gz cpu cpu load
C++ g++ 2.29 3,460 682 2.28 1% 0% 3% 100%
C gcc 1.73 2,072 448 1.72 1% 1% 0% 100%
binary-trees
secs KB gz cpu cpu load
C++ g++ 12.90 297,932 892 12.88 1% 0% 0% 100%
C gcc 9.28 150,364 906 9.26 0% 0% 1% 100%
C++ g++

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)

C gcc

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)