Re: GCC optimization

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

 



On Tue, 2003-06-10 at 00:17, John Haxby wrote:
> Christos E. Chrisostomidis wrote:
> 
> > Most of the RPM packages shipped with RH9 (and older), come for a i386 
> > target.

> I think that you'll find that the RPMs are optimised for the i686 but 
> will run on an i386.

They are actually compiled with -march=i386 -mcpu=i686 which means
"generate actual i386 instructions, but put them in such an order to
bring the most benefit to i686 systems".
The difference between that and -march=i686 (which means "generate i686
instructions" and implies -mcpu=i686) is usually small.

> Applications like sendmail and samba, being 
> somewhat I/O bound, are unlikely to benefit from the marginal 
> performance that you'll get with marginal extra performance that you get 
> by sacrificing i386 compatability.

Also, strange bugs may be triggered by compiling apps with optimizations
not widely tested.

> Things like the gimp and MP3 
> encoders/decoders, that is, CPU bound applications, get rather more 
> benefit from sacrificing i386 compatability and these are largely taken 
> care of anyway.

Yes. Usually, only heavy-duty multimedia apps are likely to benefit from
tough optimizations, and even then the gain may not be big.

Still, if there is an absolute need for that, one may try something like
this:

# cat /root/.rpmrc
optflags: athlon -O2 -march=athlon-xp -mfpmath=sse
optflags: i686 -O2 -march=pentium3 -mfpmath=sse
# 

(replace pentium3 with pentium4 if appropriate)

This way, the i686.rpm packages will actually be optimized for Pentium3
(or 4) processors, and athlon.rpm packages will be optimized for
AthlonXP processors. There will not be any backward compatibility, you
will have to run them on those CPUs.
For CPUs with large caches (probably 512k or above, but i'm not sure) it
may make sense to try -O3 instead of -O2. Well, try it anyway, it may
just yield better results anyhow. But it largely depends on the
application, there is no hard rule.

I'm not sure of the benefit of it for typical Internet applications.
Also, you need a new gcc (i think 3.2 or newer, but i'm not sure).

-- 
Florin Andrei

"Privacy is such a 20th century concept." - Darren Reed




[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux