Ken Moffat | 24 May 2012 04:34

Experiment: using -O3 in the toolchain

 Last month, I was querying the use of -O3 in glibc with x86_64 on
lfs-dev : turned out my problems on that one machine are down to
buying cheap consumer-grade hardware (it works, mostly) :)  But I
then got to thinking about using -O3 for the rest of the toolchain.
I've now completed test builds (CFLAGS and CXXFLAGS = -O2 everywhere,
and with -O3 in chapter 5 pass 2 and chapter 6 binutils, gmp, mpc,
mpfr,gcc).  Note that some packages, particularly in BLFS, ignore
CFLAGS.  The toolchain testsuite results are no different (same
failures in gcc, and with static libs which I do not install).

 This is x86_64 on an i3 (hyperthreaded dual processor, the kernel
thinks it is 4 processors) with 4GB of RAM.  I built these in
directories because they aren't intended to be used, and I didn't
build the kernel (that would be another 4 or 5 minutes!).

 Apart from that, I built everything that is currently part of my
normal desktop, and using -j3 for builds (but not installs!) except
where that gives problems.  I try to reserve some cpu so that cron
jobs, particularly backups, can run, or  so that I can browse or
listen to music if I wish to, in both cases without impacting the
build time or my listening/browsing experience.

 It's nice to now have hardware that is capable of building with -O3
on current gcc (my previous single processor machines were too slow
and too lacking in RAM), but I don't think I'll bother again.

 I used my standard scripts, so timing for each package is from
configure to the end of the install, to the nearest second.  The
times for the total build were 6 hours and 6 hours 3 minutes with
the -O3 toolchain.  The -O3 build used slightly more disk space in
(Continue reading)

Andrew Elian | 25 May 2012 01:27
Picon
Favicon

Re: Experiment: using -O3 in the toolchain

On Thu, May 24, 2012 at 03:34:21AM +0100, Ken Moffat wrote:
>  Last month, I was querying the use of -O3 in glibc with x86_64 on
> lfs-dev : turned out my problems on that one machine are down to
> buying cheap consumer-grade hardware (it works, mostly) :)  

<snip>

>  So, I wondered how using -O3 in the toolchain would affect the
> build, and now I know.  Back when I first arrived here,
> optimisations were in vogue among some people to speed up our
> compiles.  I think I can happily avoid investigating optimisations
> again. :)
I remember using optimizations to get just a bit more out of what I had
at the time.  CFLAGS="-O3 -mcpu=pentium -march=pentium"  on 100MHz of
non-mmx performance!  Quick - where's my lilo boot floppy ...  It sure
did take a while to compile, especially KDE.  That took my machine a few
days to do.  The end result was pretty wonderful though.

Old habits die hard, so I continue to use optimizations as much as
possible.  I found it does add to the time compiling, however, I'd be
hard pressed to say that it speeds up how fast the binaries run.
It just might be it doesn't make any difference.
Of course, I am using somewhat more mordern system nowadays.

ae
-- 
My Blog: http://elian001.wordpress.com
--

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
(Continue reading)


Gmane