On Friday 09 January 2004 7:11 am, Spider wrote:
> begin  quote
> On Fri, 9 Jan 2004 09:09:17 +0100 (CET)
>
> Pawel Maczewski <[EMAIL PROTECTED]> wrote:
> > Hi,
> >  I finally compiled my first gentoo system. right now, it's quite
> >  small, cause I was thinking about not to compiling anything that I
> >  won't
> > need. But I'd like to get better performance, optimize some compiler
> > flags... So, that's my question: what kind odf mcpu and march should I
> > choose as I have AMD Duron CPU? my /proc/cpuinfo is this:
> >
> >
> > model name      : AMD Duron(tm) processor
> > stepping        : 1
> > cpu MHz         : 800.045
> > cache size      : 64 KB
> > flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca
> > cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow
>
> I'd suggest
> CFLAGS="-march=athlon -O2 -fomit-frame-pointer -pipe"
>
> (-march implies -mcpu, so stating cpu would be redundant)
> i wouldn't suggest -O3 for this system as you are low on CPU cache,
> which means that you'd be far better off with the smaller, tighter,
> binaries of -O2 .
>
> > and, one more thing - if I wanted to change the compiler flags (maybe
> > the-mcpu and -march also) do I have to go through all the compilation
> > once again (bootstrap, etc)?
>
> No, you don't need to. Just rebuilding the packages (if you really see
> the need , then rebuilding all packages can be done with emerge -e
> world)
>
> However, there is little performance to gain between -march=i686 and
> -march=athlon,  though there might be bordercases.  the cache issue with
> -O3 vs. O2 is bound to give you a better boost though.
>
> //Spider

Durons under 1000Mhz are the same architecture as athlon-tbird, but just with 
a smaller on-die cache, so I would use athlon-tbird. I use march-athlon-xp 
for a box I have with a Duron 1300Mhz, which is actually a crippled 
athlon-xp. I only use -march=athlon-xp, as using the -mcpu flag will generate 
code which is also usable on lessor cpus, whereas the -march flag will only 
generate code that is usable on the specific (or higher) cpu. I see no point 
in generating code that will run on a Pentium Pro, when I have an athlon-xp, 
and never intend running this installation with any other cpu.

Of course there's much debate on whether any of this makes much real-world 
difference performance-wise, but I'm of the opinion that it's worth squeezing 
every bit of performance from the hardware, and that optimizing for your 
specific system/cpu architecture always makes sense. If your cpu is capable 
of certain features and posesses specific design parameters, what's the point 
of NOT optimizing your code by specifying the gcc flags that will take 
advantage of them? 

Robert Crawford

--
[EMAIL PROTECTED] mailing list

Reply via email to