While trying to get a little bit more performance out of 2006e imapd, I found the interesting GCC optimization discussion in src/osdep/unix/Makefile.

> The general concensus seems to be that -O2 is the one to use.  Over
> the years, I've been told to use many different settings, including
> -O6.  In recent versions of GCC [as of 2/2005], -O6 generates bad
> code that, among other ill effects, causes infinite loops.  -O3 seems
> to be safe, but empirical observation from our local expert indicates
> that in some (many?) cases -O3 code runs slower than -O2.

In current official GCC, -O6 (and any other -On > 3) are exactly the same as -O3, and as far as I know, this has always been true for official GCC. The obsolete fork of GCC "pgcc" did something special for -O6 I think, but hopefully no one is using that anymore. So, I'm not sure where the -O6 myth comes from, other than that there's a very widely-held belief that it does something special, and is somehow dangerous.

I can confirm that -O3 does not seem to yield significantly better code than -O2. For selecting a large mix mailbox with a warm cache, -O3 over -O2 yielded only a very small 0.047% average performance increase.

> GCCCFLAGS= -g $(GCCOPTLEVEL) -pipe -fno-omit-frame-pointer

On most modern GCC targets, the frame pointer is no longer required to debug. I doubt "omitting" it is going to yield a huge performance boost, though. In any case, if a target needs a frame pointer to debug, and you put -g, the -fno-omit-frame-pointer is entirely redundant.
_______________________________________________
Imap-uw mailing list
Imap-uw@u.washington.edu
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to