KDE optimizations...

Collins Richey erichey2
Wed Aug 11 14:57:10 PDT 2004


On Wed, 11 Aug 2004 14:04:28 -0400 Tim Wunder <tim at thewunders.org> wrote:
> On 8/5/2004 5:06 PM, I believe that Jerry McBride wrote:
> > As suggested on the gentoo mailing list... I recompiled KDE 3.2.3 using -Os 
> > compiler optimization and my results have been very positive.
> > 
> > The most notable change was the decrease in installed footprint. File size 
> > went from 348meg to less than 329meg. Load time for the various apps is the 
> > second notable performance boost. My seat-o-da-pants-ometer seems like 
> > perhaps a %30 decrease in load time. As for execution, no real, notable 
> > change. 
> > 

> 
> For grins, I forward your mail to the kde-redhat-users group where Rex
> Deiter (the maintainer) responded thusly, when asked what optimizations,
> if any, the kde-redhat team uses to compile KDE:
>  > Standard rpm opts: -O2 -march=i386 -mcpu=i686
>  >
>  > In the past, I had experimented with: -Os -march=i386 -mcpu=i686 and
>  > gave up on that eventually, after I experienced some wierd behavior,
>  > which was possibly optimization/compiler error.
>  >
>  > As a matter of fact, I've found a couple of -Os gcc optimization bugs
>  > (in a couple of non-kde packages), and when I reported them to
>  > redhat, was told that -Os isn't supported really, and should be using
>  > -O2 anyway.
>  >
>  > Since then, I've been of the opinion that the slightly larger binary
>  > size is worth the piece-of-mind (and worrying less about compiler
>  > issues).
>  >
>  > -- Rex
> 
> Now I have no idea what -Os vs. -O2 means, but I'll be sticking with the 
> pre-compiled RPMs of KDE 3.x as supplied by the kde-redhat folks for my 
> installs of Fedora Core 2. But, it's linux, do what suits you :-)
> 

Just a little background:

1. Per the writeup re the compiler, -Os is very similar to -O2 in the
optimizations chosen, but optimizations that would increase the size of the
executable are suppressed. Executables compiled with -Os are usually much
smaller than those produced with -O2 or -O3.

2. There's quite a bit of literature about this, including some comments from
Linus himself, but none of it conclusive.

3. Most of the reports about bad results with -Os appear to be related to
earlier versions of gcc (i.e. compiler bugs) and machine specific problems (K6
and non-x86 machines, probably also compiler bugs). Gentoo enforce -O2
optimization for some packages (glibc among others because of the compiler
instability on K6 and non-x86 machines.)

4. I'm in the process of recompiling most of my system with -Os as an
experiment, so I'll keep you posted. I haven't gotten around to kde or gnome
yet, but glibc and xorg-x11 and mozilla have produced no errors (-march=pentium4
-Os -pipe -fomit-frame-pointer.) Some ebuilds (mozilla I believe) don't tolerate
-fomit-frame-pointer, so this is filtered out.

Enjoy,

-- 
 /\/\
( CR ) Collins Richey
 \/\/     Grant me the senility to forget the people I never liked anyway, 
             the good fortune to run into the ones I do, and the eyesight 
	     to tell the difference.




More information about the Linux-users mailing list