[RULE] Is it worth rebuilding from source RPMs for a specific CPU type?

Michael Fratoni mfratoni at tuxfan.homeip.net
Wed Apr 30 05:33:33 EEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 29 April 2003 05:39 pm, M. Fioretti wrote:
> On Tue, Apr 29, 2003 17:06:07 at 05:06:07PM -0400, C David Rigby 
(cdrigby at 9online.fr) wrote:
> > Above and beyond the issue of the lack of an "i386" kernel in later
> > versions of RedHat, I am wondering if there is any significant
> > performance advantage to compiling the source RPMs (SRPMS) for a
> > specific processor.
>
> I have read several times that this makes a difference only for those
> programs and libs that can use the instructions and capabilities of
> those better processors, and that usually this means multimedia
> stuff. In other words, a recompiled find, grep, or emacs may show no
> difference at all, xine or xmms may (may!) go sensibly faster.

It's hard to say what benefit, if any, would be gained given the time 
involved in the process. The default for i386.rpm packages is to compile 
with:
- -O2 -march=i386 -mcpu=i686
Which builds an i386 compatible binary, optimized for an i686 

> > I am assuming that the rpm "--rebuild" option or rpmbuild, depending
> > on the version of rpm used, actually cares about and optimizes for a
> > particular Intel CPU family, depending on the CPU installed in the
> > computer.

The default is to build for the i386 regardless of the installed 
processor.

('rpm --showrc | grep target' to see the defaults)

> My understanding is that you have to write it in the makefile, ie that
> rpm is not so smart and daring to jump over you and say "lemme
> optimize this". Which, if confirmed, sounds much more sensible if you
> ask me.

No need to modify the make file. You can specify default options in your 
~/.rpmmacros file. Also, rebuilding with "rpmbuild --rebuild 
- --target=i686 some.spec, would result in the following defaults:
- -O2 -march=i686

target=athlon would give you:
- -O2 -march=athlon

To see your defaults:
rpm --showrc | grep optflags

Binaries built like this would not run on older hardware, and may or may 
not be faster. It's unlikely that any speed increase would be noticed by 
the user, benchmarking would probably be required to determine any 
benefit.

- -- 
- -Michael

pgp key:  http://www.tuxfan.homeip.net:8080/gpgkey.txt
Red Hat Linux 7.{2,3}|8.0 in 8M of RAM: http://www.rule-project.org/
- --

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+rzX9n/07WoAb/SsRAnH4AJ4sxhZhWroB4RV9UwOPD0gb2cwKgwCfRtiN
XNLb6AImBqA/LeuTSgIOb6o=
=nFgi
-----END PGP SIGNATURE-----



_______________________________________________
Rule Project HOME PAGE:  http://www.rule-project.org/en/
Rule Development Site:   http://savannah.gnu.org/projects/rule/
Rule-list at nongnu.org
http://mail.nongnu.org/mailman/listinfo/rule-list



More information about the Rule-list mailing list