Compile time, over time

I’ve been getting the impression for a while that the GCC C Compiler has been getting slower over time at compiling. To check whether this was in fact true, I timed building a popular software package (emacs) with each major version of the compiler that I could get ahold of. I also added in a few other compilers, for reference.

For the benchmark, I built the temacs part of the GNU emacs distribution (version 22.3). System used is a 1.6GHZ AMD Sempron, 512MB RAM, running Fedora 13.

The compilers used were:

  • gcc – The GNU C Compiler – the standard system compiler on virtually all Linux distributions.
  • llvm – Low-Level Virtual Machine – a new(ish) compiler being developed by Apple and the University of Illinois. It uses the new clang front-end.
  • icc – The Intel C++ Compiler – Intel’s own compiler, known for aggressive optimizations.
  • pcc – The Portable C Compiler – a modernized version of the original BSD Unix system compiler.

Optimization off

Compiler

(version)

Compile

Time (-O0)

seconds

% change

(vs. gcc 3.4)

% change

(vs. prev version)

gcc 2.7.2.3 13.9 +35%  
gcc 2.8.1 14.5 +32% -4%
gcc 2.95.3 16.4 +23% -13%
gcc 3.0.4 20.1 +6% -23%
gcc 3.1.1 22.0 -3% -9%
gcc 3.2.3 21.9 -3% +1%
gcc 3.3.6 20.7 +3% +5%
gcc 3.4.6 21.3   -3%
gcc 4.0.4 22.4 -5% -5%
gcc 4.1.2 22.5 -5% -1%
gcc 4.2.4 22.2 -4% +1%
gcc 4.3.5 25.3 -19% -14%
gcc 4.4.5 26.7 -25% -6%
gcc 4.5.2 28.8 -35% -7%
gcc 4.6 (pre) 29.4 -38% -2%
       
llvm 2.8 29.6 -39%  
llvm 2.9 (pre) 19.9 +7% +33%
       
icc 11.1 21.0 +1%  
icc 12.0 17.5 +18% +17%
       
pcc 1.1 (pre) 21.6 -1%  

Optimization On

Compiler

(version)

Compile

Time (-O2 -g)

seconds

% change

(vs. gcc 3.4)

% change

(vs. prev version)

gcc 2.7.2.3 24.0 +64%  
gcc 2.8.1 27.7 +59% -15%
gcc 2.95.3 40.0 +41% -44%
gcc 3.0.4 52.6 +22% -32%
gcc 3.1.1 63.7 +6% -21.1%
gcc 3.2.3 63.9 +6% +0%
gcc 3.3.6 66.5 +2% -4%
gcc 3.4.6 67.6   -2%
gcc 4.0.4 76.1 -13% -13%
gcc 4.1.2 83.9 -24% -10%
gcc 4.2.4 103.4 -53% -23%
gcc 4.3.5 100.7 -49% +3%
gcc 4.4.5 109.1 -61% -8%
gcc 4.5.2 112.6 -67% -3%
gcc 4.6 (pre) 113.7 -68% -1%
       
llvm 2.8 79.1 -17%  
llvm 2.9 (pre) 72.9 -8% +8%
       
icc 11.1 91.6 -36%  
icc 12.0 96.6 -43% -5%
       
pcc 1.1 (pre) 28.8 +57%  

 

Comments are closed.