Mark Calahan was just asking about what gcc compilation flags people use. (Not sure if Facebook Notes recognize pingbacks or not, so I sort of hope Mark is reading planetmysql, too)
Most of the distros build with -O2 (except for Gentoo, which compiles with as many flags as they can find) It's also the default in autoconf, the rationale being, I believe, that -O3 doesn't give discernable benefit for most things, but does require a considerably higher CPU cost during the compile. If you are, say, Debian, and you're compiling over 10k packages, streamlining the compile for the normal case is probably a great idea.
In Drizzle, however, we do override that default and build with -O3 at all times. I did some testing in our benchmark system about a month ago, mainly because I wanted to verify that -O3 was worth the extra effort that's in our autoconf files to do the override. I don't remember the exact numbers (I can re-run if someone really wants to know) but it was significant (something is telling me 25%) My next step was going to be compiling with -O2 and each of the individual optimizations that are in -O3 and not in -O2 to try to find out where the win was coming from. Haven't done it yet, though.
The original reason I bumped us to -O3 had nothing to do with performance though, oddly enough, it had to do with an increased set of warnings generated in some of the warning flags. Again, rather uselessly I do not remember the exact warning that gets generated only under -O3 (and I don't ever see if because we fixed it and moved on) but it's perhaps another reason why one should build free of compiler warnings - some of those "dangerous" constructs that the dev things the compiler is "wrong" about actually might be problematic at higher optimization levels. :)
PlanetMySQL Voting: Vote UP / Vote DOWN