I decided to spend a few hours experimenting with compiler options in
Gentoo last night. I wanted to measure the performance difference of
"optimal" compiler settings. I built Gentoo from stage 1 with the
following options:
"Optimal" settings, based on Gentoo documentation:
CFLAGS="-march=athlon-mp -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
"Base" settings:
CFLAGS="-O2"
CHOST="i386-pc-linux-gnu"
The configuration of the system was exactly the same other than the
above settings. I initially built the system with the "optimal"
settings, performed a benchmark, then rebuilt the entire system with the
"base" settings.
The benchmark itself was performed immediately after a reboot of the
system, and consisted of the extraction and compilation of the Linux
kernel version 2.4.21.
"Optimal" settings:
tar jxf linux-2.4.20.tar.bz2
real 0m26.505s
user 0m24.495s
sys 0m1.840s
bzcat patch-2.4.21.bz2 | patch -sp1
real 0m6.090s
user 0m5.180s
sys 0m0.880s
make dep
real 0m43.727s
user 0m40.635s
sys 0m7.775s
make -j3 bzImage
real 3m6.124s
user 5m52.900s
sys 0m16.010s
make clean && make -j3 bzImage
real 3m5.722s
user 5m52.340s
sys 0m15.595s
"Base" settings:
tar jxf linux-2.4.20.tar.bz2
real 0m26.701s
user 0m25.040s
sys 0m1.525s
bzcat patch-2.4.21.bz2 | patch -sp1
real 0m8.076s
user 0m6.190s
sys 0m1.005s
make dep
real 0m43.859s
user 0m37.245s
sys 0m7.435s
make -j3 bzImage
real 2m18.809s
user 4m19.425s
sys 0m14.850s
make clean && make -j3 bzImage
real 2m18.003s
user 4m18.445s
sys 0m14.930s
The kernel was built using the same .config both times. The only
expected difference between the two benchmark runs is that the Gentoo
system had been rebuilt with altered CHOST and CFLAGS settings in the
make.conf.
The most interesting number is for the "make -j3 bzImage"--the
supposedly optimal system resulted in a compile time of 3m6.124s,
whereas the base system resulted in a compile time of 2m18.809s.
I don't claim that this benchmark is scientific, or definitive. It was
planned to be a comparison of the effects of compiler settings on the
performance of the whole system. I'd be very interested to see others
reproduce the benchmark and what figures result from that reproduction.
Cheers,
-mjg
--
Matthew Gregan |/
/| [EMAIL PROTECTED]