On Fri, May 30, 2014 at 07:36:24AM +0900, Mike Hommey wrote: > On Thu, May 29, 2014 at 12:21:06PM -0700, Russ Allbery wrote: > > Xavier Roche <xav...@debian.org> writes:
> > > I have a rather silly question: most (all ?) packages are built by > > > default with -02 - something which is inherited from autotool's '-g -O2' > > > default flagsd, I presume. > > > Is -O3 considered too dangerous ? (AFAICS, potential issues are mainly > > > present in O2) Or is it considered worthless because the performance > > > gain would be really low ? > > Historically, -O3 has usually been slower than -O2 for a lot of software > > because the aggressive loop unrolling increases code size and interferes > > with processor caching strategies. I don't know if that's now been fixed > > in GCC, but that's probably much of the historical reason. > That's still true. On which architectures, and for which software? Maybe this is a problem only on i386, or only for firefox? The current default of -O2 is based on the fact that adding -O3 may give worse results than -O2. But that's not the same thing as -O2 *always* giving *better* results than -O3, or giving better results often enough to warrant it being the default. There must be a tipping point where it makes sense in terms of overall efficiency to switch to -O3 as the default (perhaps on a per-arch basis), and let -O2 be the exception rather than the rule. I don't think we have a clear idea of where that tipping point is, because I don't think anyone has measured this systematically since the -O2 default was set in policy nearly two decades ago, before amd64 even existed. FWIW, the recent port of Ubuntu to ppc64el uses -O3 as the default, because IBM has broad experience in resolving performance issues for their own hardware and have found that -O3 gives an overall better experience for their customers. It will be difficult for Debian to gather the same kind of information across all its architectures, but we shouldn't conclude, just because it's difficult to know the right answer, that -O2 is definitely the right answer. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ slanga...@ubuntu.com vor...@debian.org
signature.asc
Description: Digital signature