/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® quad-core |
This chart shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.
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.
Look at speed another way - look at a box plot of Time-used data.
This table shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.
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 | |
| regex-dna | 1/2 | 3× | ± | |
| binary-trees | 1/2 | 1/2 | ± | |
| fasta-redux | ± | 1/3 | ± | |
| fasta | ± | ± | ± | |
| mandelbrot | ± | ± | ± | |
| pidigits | ± | 1/2 | ± | |
| fannkuch-redux | ± | 1/3 | ± | |
| reverse-complement | ± | 2× | ± | |
| spectral-norm | ± | ± | ± | |
| n-body | ± | ± | ± | |
| k-nucleotide | 5× | ± | ± | |
| C GNU gcc used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (Elapsed secs) | 1/2 | 1/2 | ± | ± | ± | ± | 5× |
± read the measurements and then read the program source code.
This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ≈ CPU Load ~ speed and size.
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 |
|---|---|---|---|---|---|
| regex-dna | |||||
| C GNU gcc | 5.90 | 2.60 | 306,884 | 2579 | 43% 66% 74% 49% |
| C++ GNU g++ | 15.70 | 5.03 | 90,944 | 1759 | 90% 89% 76% 57% |
| binary-trees | |||||
| C GNU gcc | 13.09 | 5.44 | 150,720 | 850 | 94% 46% 66% 34% |
| C++ GNU g++ | 27.51 | 9.04 | 360,536 | 892 | 96% 85% 66% 60% |
| fasta-redux | |||||
| C GNU gcc | 1.68 | 1.68 | 332 | 1321 | 0% 1% 1% 100% |
| C++ GNU g++ | 2.00 | 2.00 | 1,008 | 1474 | 0% 0% 100% 1% |
| fasta | |||||
| C GNU gcc | 5.85 | 5.85 | 332 | 1221 | 0% 1% 100% 0% |
| C++ GNU g++ | 6.19 | 6.20 | 332 | 1266 | 0% 0% 0% 100% |
| mandelbrot | |||||
| C GNU gcc | 23.49 | 5.88 | 27,008 | 799 | 100% 100% 100% 100% |
| C++ GNU g++ | 24.31 | 6.11 | 32,228 | 1017 | 100% 100% 100% 100% |
| pidigits | |||||
| C GNU gcc | 2.29 | 2.29 | 896 | 541 | 2% 0% 0% 100% |
| C++ GNU g++ | 2.29 | 2.30 | 1,580 | 682 | 0% 0% 1% 100% |
| fannkuch-redux | |||||
| C GNU gcc | 49.50 | 12.71 | 368 | 1557 | 100% 95% 98% 99% |
| C++ GNU g++ | 48.54 | 12.44 | 1,164 | 1440 | 100% 100% 93% 98% |
| reverse-complement | |||||
| C GNU gcc | 1.02 | 0.73 | 476,108 | 1867 | 28% 0% 88% 29% |
| C++ GNU g++ | 1.07 | 0.69 | 245,668 | 2275 | 20% 16% 42% 88% |
| spectral-norm | |||||
| C GNU gcc | 10.66 | 2.67 | 688 | 1139 | 100% 100% 100% 100% |
| C++ GNU g++ | 10.03 | 2.52 | 688 | 1044 | 100% 100% 100% 100% |
| n-body | |||||
| C GNU gcc | 20.72 | 20.73 | 328 | 1429 | 0% 0% 100% 0% |
| C++ GNU g++ | 19.35 | 19.36 | 356 | 1659 | 0% 0% 0% 100% |
| k-nucleotide | |||||
| C GNU gcc | 43.67 | 16.61 | 180,352 | 2280 | 34% 38% 100% 95% |
| C++ GNU g++ | 11.62 | 3.35 | 138,544 | 3415 | 83% 81% 86% 98% |
Remember - those are just the fastest C GNU gcc and C++ GNU g++ programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for C GNU gcc.
Maybe one of those other C GNU gcc programs is fastest on a different OS/machine.
Remember - those are just the fastest C GNU gcc and C++ GNU g++ programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.
Maybe one of those other programs is fastest on a different OS/machine.
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
Online book: The C Book
Home Page: http://gcc.gnu.org/
Download: ftp://ftp.gnu.org/pub/gnu/gcc/