*BSD News Article 54380


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!news.seanet.com!news.seanet.com!michaelv
From: michaelv@MindBender.HeadCandy.com (Michael L. VanLoon)
Newsgroups: comp.unix.bsd.freebsd.misc,gnu.gcc.help,comp.os.linux.misc
Subject: Re: gcc optimisations when compiling the kernel
Date: 03 Nov 1995 07:44:10 GMT
Organization: HeadCandy Associates... Sweets for the lobes.
Lines: 40
Message-ID: <MICHAELV.95Nov2234411@MindBender.HeadCandy.com>
References: <478mtj$e2v@plato.ucsalf.ac.uk>
NNTP-Posting-Host: mindbender.seanet.com
In-reply-to: mark@plato.ucsalf.ac.uk's message of 1 Nov 1995 20:56:19 -0000
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:8487 gnu.gcc.help:13775 comp.os.linux.misc:69240

In article <478mtj$e2v@plato.ucsalf.ac.uk> mark@plato.ucsalf.ac.uk (Mark Powell) writes:

   Looked in the handbook and the FAQ and couldn't find anything in there on
   which optimisations to use when compiling the kernel. Although I knew the
   -m486 flag would produce slightly faster code on a 486 with only slightly 
   larger binaries, I was informed that it would actually reduce performance on
   a Pentium.

Whoever told you that was full of it.  What is good for a 486 is
almost always good for a Pentium, since the Pentium could be viewed in
a certain paradigm as a further derivation of the optimizations started
in the 486.

The XFree86 team has reported in the past that -m486 speeds up X code
on 486s by a measurable percentage (can't remember -- 10%? 20%?).
They also said, if I remember right, that similar results were seen on
Pentiums.  They stated that the performance penalty on 386s was much
less than the performance win on 486s and higher.  Which is why all
officially released XFree86 binaries are built with -m486.

Pentium-specific optimizations might only be good on a Pentium, in
some cases.  Reports have been heard that most of the Intel-approved
Pentium compiler optimizations, however, actually sped up 486 code
significantly, as well.

One other option that is *highly* recommended if you have a
comfortable amount of RAM is "-pipe".  It won't affect the generated
code, but it can speed up compiles nicely.  It uses pipes to link
input and output of compile stages instead of writing to the disk and
reading back.  (Comfortable amount of RAM means that you don't swap
excessively with your current setup.)

--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Michael L. VanLoon                                 michaelv@HeadCandy.com
       --<  Free your mind and your machine -- NetBSD free un*x  >--
     NetBSD working ports: 386+PC, Mac 68k, Amiga, HP300, Sun3, Sun4,
                           DEC PMAX (MIPS), DEC Alpha, PC532
     NetBSD ports in progress: VAX, Atari 68k, others...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -