Compared GCC compilation time on two Linux desktops

This page compares the compilation time of the GCC (the GNU Compiler Collection free compiler) compiler on two recent Linux/Debian/Sid destop machines. It may help developers to choose a desktop, especially if they have to work on the GCC compiler itself.

Systems configuration

The two desktops compared are my office desktop and my own home self-built machine (The curious reader might guess which is which by knowing that I do like listening to russian classic music).

what #1 #2 notes
hostname glinka is003339
Linux distribution Debian/Sid/AMD64 (x86_64) Debian/Sid/AMD64 (x86_64) both systems updated on may 23 2006
Linux kernel SMP SMP self compiled recent kernels with builtin support for disk and Ext3 filesystem
desktop model self-assembled,
ASUS A8N SLI Deluxe motherboard,
DELL Optiplex GX620
chipset Nforce4 SLI Intel 945
processor AMD64 X2 4400 dual-core Pentium 4 D 960 bi-threaded
clock frequency 2211 MHz 3591 MHz from /proc/cpuinfo/
bogomips 4427 7188 useless figure
on-chip cache 1024 Kbytes x 2 core (=2Mb total) 2048 Kbytes
RAM 2 Gigabytes 1 Gigabyte
hard disk SATA 150Gb 10000RPM
Western Digital Raptor WDC WD1500ADFD
SATA 160Gb 7200RPM
Seagate Barracuda ST3160828AS
graphic card ATI X550 ATI X600
C compiler gcc 4.0.4 gcc 4.0.4 Debian compiler used for first compilation. The gcc build process include a second self-re-compilation
date of installation mid-may 2006 march 2006 First power-up and Debian installation
approximate cost 1100 € 1000 € French cost of CPU box without screen, VAT included

Built GCC version and configuration

The compiled GCC version is the snapshot obtained by GCC Subversion repository. The (common to both tested systems) revision number is 114014, so to get the same source code just type:

svn co -r114014 svn:// gcc

The configuration of the built GCC is done by making a fresh directory _GccObj with the same parent as the gcc directory obtained by the above command, i.e.

cd gcc
mkdir ../_GccObj
cd ../_GccObj

And then by configuring with

../gcc/configure   --program-suffix=_snap --disable-multilib --verbose --enable-languages=c,c++

The --disable-multilib option builds only a 64 bits native compiler, without any 32 bits legacy. Only C & C++ compilers are built (no Ada or Java or Fortran).

Compilation timings

Both machines got a batch job (on a lightly loaded setting) doing after the above configure command

cd _GccObj
time make -j2
full build time
what #1 #2 notes
hostname glinka is003339 as above
time real 39m2.591s = 2342.591
user 64m9.474s = 3849.474
sys 3m27.659s = 207.659
real 53m53.320s = 3233.320
user 89m11.238s = 5351.238
sys 4m32.723s = 272.723
(time in seconds) output of the time make -j2 command; the CPU user time is nearly twice as big as the real clock time because of the -j2 make option and the dual-core or bi-threaded CPUs.
time ratio real 1.0
user 1.0
sys 1.0
real 1.32
user 1.39
sys 1.3133
normalized time to best

The Dual Core AMD64 glinka seems significantly faster than the Intel Pentium D is003339 (both running in 64 bits mode) and for GCC hackers it is worthwhile to have a powerful machine (it might even have sense to use the distcc compiler front-end to distribute the compilation load; this requires a good networking connection).

By Basile Starynkevitch (may 23rd 2006)
$Id: compare_time_gcc.html 83 2006-05-23 16:26:33Z basile$