[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sheflug] CFLAG Question
Wonkey Donkey wrote:
> 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.
>
IMHO -O3 isn't worth it, for most apps. Beyond -O2 it's only really
worth it for maths/physics simulations etc where the bottleneck is the CPU.
Personally i run -Os which is -O2 but then optimized for smaller binary
size and is thought of highly on gentoo.org forums.
When I last did some simulations there was a noticeable difference in
runtime for 02 -> 03 but that was mainly floating point. Can't ever say
I've seen much difference in normal system usage.
Setting your USE flags minimally and tuning your filesystem give more
noticeable improvement than O2->O3
James
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.