1 : At a glance - Are the C gcc programs faster?

Each chart bar shows, for one unidentified benchmark, how much the fastest C gcc program used compared to the fastest Java program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Approximately - Are the C gcc programs faster?

Each table row shows, for one named benchmark, how much the fastest C gcc program used compared to the fastest Java program.

(Memory use is only compared for tasks that require memory to be allocated.)

 C gcc used what fraction? used how many times more? 
Benchmark Time Memory Code
 regex-dna1/31/2
 reverse-complement1/3±1/2
 n-body1/2 ±
 spectral-norm1/2 1/2
 fannkuch-redux1/2 ±
 pidigits1/2 1/2
 binary-trees1/21/2
 fasta-redux1/2 ±
 mandelbrot± ±
 fasta± ±
 k-nucleotide±1/6±
 C gcc used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/31/31/21/2±±±

± read the measurements and then read the program source code.

 3 : Measurements - Are the C gcc programs faster?

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest C gcc program are shown for comparison against measurements of the fastest Java program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 regex-dna 
C gcc5.812.45314,2002579  71% 52% 45% 71%
Java24.708.24761,724929  68% 73% 77% 83%
 reverse-complement 
C gcc0.750.49251,716741  33% 20% 31% 72%
Java2.681.27315,2961661  41% 48% 34% 92%
 n-body 
C gcc10.5010.509681490  100% 0% 1% 1%
Java22.6822.6630,0361424  97% 3% 0% 1%
 spectral-norm 
C gcc8.282.091,776569  100% 100% 100% 99%
Java16.534.2832,696950  96% 96% 96% 99%
 fannkuch-redux 
C gcc35.659.101,516910  99% 96% 97% 100%
Java68.6417.4133,0321282  98% 98% 99% 99%
 pidigits 
C gcc1.721.731,996448  2% 1% 1% 100%
Java3.223.1233,528938  3% 2% 80% 21%
 binary-trees 
C gcc10.183.26160,856906  64% 76% 75% 99%
Java8.005.67356,656583  39% 39% 36% 32%
 fasta-redux 
C gcc1.571.576641321  2% 1% 100% 1%
Java2.652.5929,9401443  1% 76% 1% 25%
 mandelbrot 
C gcc19.775.1332,240694  95% 96% 100% 96%
Java24.246.2788,992796  96% 97% 97% 98%
 fasta 
C gcc5.361.972,4721914  61% 34% 78% 99%
Java5.602.1939,3682457  58% 72% 66% 61%
 k-nucleotide 
C gcc35.0511.64190,2242280  59% 96% 96% 53%
Java38.6611.291,118,2881844  83% 97% 82% 82%

 4 : Are there other C gcc programs for these benchmarks?

Remember - those are just the fastest C gcc and Java programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for C gcc.

Maybe one of those other C gcc programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest C gcc and Java 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.

 C gcc : unchecked low-level programming 

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)

Online book: The C Book

Online book: Looking for 4x speedups? SSE to the rescue! pdf slides

Home Page: http://gcc.gnu.org/

Download: ftp://ftp.gnu.org/pub/gnu/gcc/

Revised BSD license

  Home   Conclusions   License   Play