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

Re: [sheflug] CFLAG Question



Wonkey Donkey wrote:

>----- Original Message ----- 
>From: "James Rogers" <phb01jdr [at] shef.ac.uk>
>To: "sheflug" <sheflug [at] sheflug.co.uk>
>Sent: Tuesday, February 21, 2006 10:13 PM
>Subject: 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
>>
>>    
>>
>
>  
>
Hi Steve,

>Thanks James. I'm going to let it run its course now anyway, just to see 
>what its like with -O3.
>
>One other thought that crossed my mind is this: is there any problem 
>changing between -O2 and -O3 during the build of the complete system ?
>
>Such as now, its bootstrapping and rebuilding the toolchain using -O3, would 
>it be a major problem switching to -O2 to build the 'system'.... Just a 
>thought.
>
>  
>
I can see no obvious problem switching from -O3 to -O2 when compiling 
the rest of your system. The -O? switch is used to tune the level of 
machine code optimization performed by the compiler. Therefore, the 
resulting binary *should* execute in a logically identical manner 
regardless of the optimization level. The compiled programs may be 
larger or smaller, execute faster or slower given differing levels of 
optimization.

>As to the filesystem, yes, I was looking through the forums on that earlier 
>too. The general opinion was that ext3 is still definitely the recommended 
>way to go, which Im happy with as Ive always used it and never had any 
>problems.
>
>  
>
I would suggest sticking with ext3 unless you require a file system 
tailored towards a specific purpose, e.g. storage of huge files.

>There are also a couple of interesting posts about which journalling method 
>should be used, and the various associated flags. And also a very good post 
>about fragmentation, optimisation etc, something I have never actually 
>considered until now.
>
>As for USE flags, mine are anything but minimal to be honest. But I'll be 
>posting more on than subject in  the next day or two.
>
>Steve. 
>
>
>  
>
Andy.

>___________________________________________________________________
>
>Sheffield Linux User's Group -
>http://www.sheflug.co.uk/mailfaq.html
>
>  GNU the choice of a complete generation.
>
>
>  
>


___________________________________________________________________

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

  GNU the choice of a complete generation.