[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sheflug] CFLAG Question



Ok, first off, the distro is Gentoo, and the machine has a P4 3.2 Northwood 
CPU and 2Gb of very low latency ram.

The machine is currently building the toolchain for Gentoo, and is using a 
quite normal set of CLAGS, except for the fact that -O2 is now -O3. (I'm 
running this purely as a test, its not a production machine or anything). 
Everything I have read about it seems to suggest that the higher the -O 
value, the better optimised the resulting code will be, but at the expense 
of compilation time and memory usage.

Compared with my usual -O2 setting, this thing is taking an absolute age to 
compile and build. I did expect extra time being needed of course, but I'm 
wondering just how beneficial the end result may be and if it is worth 
bothering with -O3.

As a general question, am I likely to see a significant speed improvement 
once the machine is built and rebooted ? I don't mind the extra time if its 
going to be worthwhile; but to give you an idea of the differences I'm 
seeing right now, GCC usually takes around 25 minutes, whereas with -O3 it 
took almost an hour. Glibc is currently running and has taken well in excess 
of an hour already; it usually takes around 40 minutes.

Is a system built with -O3 going to be so much more improved than with -O2, 
and if not, can anybody suggest in simple terms why there is such a 
difference in compile times for such a small difference in the end result ?

Thanks.

Steve. 


___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.