/mobile Handheld Friendly website
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× | ± | |
| fasta-redux | 1/2 | 1/2 | ± | |
| fasta | ± | ± | ± | |
| binary-trees | ± | 1/2 | ± | |
| mandelbrot | ± | ± | ± | |
| pidigits | ± | 1/2 | ± | |
| reverse-complement | ± | 2× | ± | |
| n-body | ± | ± | ± | |
| spectral-norm | ± | ± | ± | |
| fannkuch-redux | ± | 1/3 | ± | |
| k-nucleotide | 4× | ± | ± | |
| C GNU gcc used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (Elapsed secs) | 1/2 | 1/2 | ± | ± | ± | ± | 4× |
± 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 | 6.42 | 2.90 | 288,040 | 2579 | 44% 45% 75% 69% |
| C++ GNU g++ | 17.06 | 5.79 | 94,896 | 1759 | 74% 60% 64% 100% |
| fasta-redux | |||||
| C GNU gcc | 1.68 | 1.69 | 256 | 1321 | 0% 100% 0% 1% |
| C++ GNU g++ | 2.94 | 2.94 | 580 | 1474 | 1% 0% 0% 100% |
| fasta | |||||
| C GNU gcc | 4.92 | 4.93 | 256 | 1221 | 0% 0% 0% 100% |
| C++ GNU g++ | 6.31 | 6.31 | 256 | 1266 | 0% 100% 0% 0% |
| binary-trees | |||||
| C GNU gcc | 12.81 | 4.85 | 100,460 | 850 | 23% 82% 95% 63% |
| C++ GNU g++ | 16.92 | 5.91 | 173,424 | 892 | 67% 90% 69% 58% |
| mandelbrot | |||||
| C GNU gcc | 23.34 | 5.85 | 27,452 | 799 | 100% 100% 100% 100% |
| C++ GNU g++ | 23.75 | 5.97 | 32,060 | 1017 | 99% 100% 99% 99% |
| pidigits | |||||
| C GNU gcc | 2.74 | 2.74 | 1,092 | 541 | 0% 0% 0% 100% |
| C++ GNU g++ | 2.74 | 2.75 | 1,680 | 682 | 0% 100% 0% 0% |
| reverse-complement | |||||
| C GNU gcc | 1.16 | 0.87 | 496,900 | 1867 | 24% 26% 0% 89% |
| C++ GNU g++ | 1.27 | 0.87 | 245,432 | 2275 | 51% 21% 39% 43% |
| n-body | |||||
| C GNU gcc | 20.46 | 20.47 | 284 | 1173 | 0% 0% 0% 100% |
| C++ GNU g++ | 20.15 | 20.15 | 284 | 1659 | 0% 0% 0% 100% |
| spectral-norm | |||||
| C GNU gcc | 10.25 | 2.58 | 608 | 1139 | 100% 100% 100% 100% |
| C++ GNU g++ | 10.04 | 2.52 | 608 | 1044 | 100% 100% 100% 100% |
| fannkuch-redux | |||||
| C GNU gcc | 54.47 | 14.28 | 292 | 1557 | 93% 95% 93% 100% |
| C++ GNU g++ | 47.99 | 12.23 | 952 | 1440 | 100% 96% 100% 98% |
| k-nucleotide | |||||
| C GNU gcc | 41.50 | 15.95 | 153,688 | 2280 | 36% 88% 96% 43% |
| C++ GNU g++ | 12.46 | 3.71 | 131,952 | 3415 | 79% 84% 80% 95% |
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/