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.77 644 1261 2.77 0% 1% 2% 100%
C++ g++ 4.20 1,296 1105 4.20 0% 1% 1% 100%
reverse-complement
secs KB gz cpu cpu load
C gcc 0.78 251,604 741 0.77 6% 0% 0% 100%
C++ g++ 1.03 249,856 2275 1.02 2% 2% 0% 100%
fasta-redux
secs KB gz cpu cpu load
C gcc 1.57 568 1402 1.56 0% 1% 2% 99%
C++ g++ 2.07 1,312 1474 2.06 0% 1% 2% 100%
regex-dna
secs KB gz cpu cpu load
C gcc 5.53 295,572 2579 5.51 0% 1% 1% 100%
C++ g++ 7.04 204,612 648 7.03 1% 1% 1% 100%
pidigits
secs KB gz cpu cpu load
C gcc 2.50 1,972 448 2.50 1% 0% 0% 100%
C++ g++ 2.68 3,720 682 2.67 0% 1% 1% 100%
fannkuch-redux
secs KB gz cpu cpu load
C gcc 24.20 640 1183 24.19 1% 1% 1% 100%
C++ g++ 24.65 556 1150 24.64 1% 0% 0% 100%
spectral-norm
secs KB gz cpu cpu load
C gcc 7.85 1,628 569 7.85 0% 1% 1% 100%
C++ g++ 7.93 2,256 1044 7.92 1% 0% 0% 100%
mandelbrot
secs KB gz cpu cpu load
C gcc 22.37 32,124 694 22.36 0% 1% 1% 100%
C++ g++ 20.14 33,780 726 20.13 0% 1% 1% 100%
n-body
secs KB gz cpu cpu load
C gcc 10.01 752 1490 10.01 0% 1% 1% 100%
C++ g++ 8.96 824 1545 8.96 1% 0% 1% 100%
binary-trees
secs KB gz cpu cpu load
C gcc 9.62 100,812 906 9.61 0% 1% 1% 100%
C++ g++ 6.79 76,636 846 6.78 2% 2% 1% 100%
k-nucleotide
secs KB gz cpu cpu load
C gcc 34.18 127,896 1535 34.16 1% 1% 0% 100%
C++ g++ 24.01 139,792 1252 23.94 0% 1% 1% 100%
C gcc

gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)

C++ g++

gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)