Ubuntu : Intel® Q6600® quad-core |
This chart shows 3 comparisons - Time-used, Memory-used and Code-used.
Each chart bar shows, for one unidentified benchmark, how much the fastest C GNU gcc program used compared to the fastest C++ GNU g++ program.
This table shows 3 comparisons - Time-used, Memory-used and Code-used.
Each table row shows, for one named benchmark, how much the fastest C GNU gcc program used compared to the fastest C++ GNU g++ program.
| C GNU gcc used what fraction? used how many times more? | ||||
|---|---|---|---|---|
| Benchmark | Time | Memory | Code | Reduced N |
| chameneos-redux | 1/4 | 1/2 | ± | |
| binary-trees | ± | 1/2 | ± | |
| fannkuch | ± | 1/2 | ± | |
| n-body | ± | 1/2 | ± | |
| mandelbrot | ± | ± | ± | |
| pidigits | ± | 1/2 | ± | |
| spectral-norm | ± | 1/2 | ± | |
| fasta | ± | 1/2 | ± | |
| reverse-complement | ± | 1/2 | 1/3 | |
| regex-dna | 2× | ± | ± | |
| k-nucleotide | 13× | 6× | 1/3 | |
± read the measurements and then read the program source code.
This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ~ CPU Load.
For each named benchmark, measurements of the fastest C GNU gcc program are shown for comparison against measurements of the fastest C++ GNU g++ program.
| Program Source Code | CPU secs | Elapsed secs | Memory KB | Code B | ~ CPU Load |
|---|---|---|---|---|---|
| chameneos-redux | |||||
| C GNU gcc | 2.84 | 0.72 | 580 | 2879 | 100% 97% 99% 100% |
| C++ GNU g++ | 11.33 | 2.88 | 1,168 | 1994 | 99% 99% 100% 97% |
| binary-trees | |||||
| C GNU gcc | 13.71 | 5.10 | 100,688 | 850 | 50% 34% 85% 81% |
| C++ GNU g++ | 18.86 | 6.32 | 173,332 | 892 | 60% 74% 74% 71% |
| fannkuch | |||||
| C GNU gcc | 50.54 | 12.88 | 552 | 937 | 98% 100% 98% 98% |
| C++ GNU g++ | 49.61 | 13.63 | 1,160 | 1186 | 81% 77% 100% 100% |
| n-body | |||||
| C GNU gcc | 23.52 | 23.52 | 416 | 1429 | 100% 0% 0% 0% |
| C++ GNU g++ | 23.82 | 23.82 | 788 | 1428 | 100% 0% 0% 0% |
| mandelbrot | |||||
| C GNU gcc | 24.38 | 6.11 | 27,248 | 879 | 100% 100% 100% 100% |
| C++ GNU g++ | 24.67 | 6.17 | 30,436 | 858 | 100% 100% 100% 100% |
| pidigits | |||||
| C GNU gcc | 2.71 | 2.71 | 1,012 | 541 | 0% 100% 0% 0% |
| C++ GNU g++ | 2.71 | 2.71 | 1,600 | 682 | 0% 0% 0% 100% |
| spectral-norm | |||||
| C GNU gcc | 12.00 | 3.00 | 688 | 1139 | 100% 100% 100% 100% |
| C++ GNU g++ | 11.98 | 3.00 | 1,032 | 1114 | 100% 100% 100% 100% |
| fasta | |||||
| C GNU gcc | 5.18 | 5.19 | 396 | 1221 | 100% 0% 0% 0% |
| C++ GNU g++ | 3.78 | 3.78 | 816 | 1470 | 99% 1% 0% 0% |
| reverse-complement | |||||
| C GNU gcc | 1.37 | 1.37 | 125,192 | 722 | 100% 1% 1% 1% |
| C++ GNU g++ | 1.34 | 0.92 | 245,440 | 2275 | 68% 50% 14% 15% |
| regex-dna | |||||
| C GNU gcc | 26.15 | 8.50 | 94,712 | 1525 | 67% 73% 67% 100% |
| C++ GNU g++ | 14.67 | 4.78 | 97,064 | 1759 | 84% 60% 100% 63% |
| k-nucleotide | |||||
| C GNU gcc | 53.96 | 53.96 | 802,928 | 1141 | 0% 0% 0% 100% |
| C++ GNU g++ | 14.80 | 4.31 | 132,452 | 3415 | 81% 80% 99% 84% |
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)
Online book: The C Book
Home Page: http://gcc.gnu.org/
Download: ftp://ftp.gnu.org/pub/gnu/gcc/