VOOZH about

URL: https://www.phoronix.com/news/Ubuntu-Details-No-O3-Everywhere

⇱ Ubuntu Provides More Insight Into Their Decision Not To "-O3" Optimize All Packages - Phoronix


👁 Phoronix

Ubuntu Provides More Insight Into Their Decision Not To "-O3" Optimize All Packages

Written by Michael Larabel in Ubuntu on 28 March 2025 at 06:37 AM EDT. 63 Comments
Since last year Canonical had been investigating using -O3 compiler optimizations for their Ubuntu package builds in the name of delivering better performance for Ubuntu Linux. A few weeks back though they decided they would not use -O3 optimizations for all packages. They have now provided more engineering insight into their reasoning and the results of their investigation into -O3 compiler optimizations for more packages.

Long story short, with distribution-wide -O3 compiler optimizations they didn't have enough compelling performance benefits to justify the effort. They also found some performance regressions and the -O3 optimizations adversely impacting some load times as well as larger binary sizes in some cases.

For example, they found a 12% performance hit to GNU Radio, TIFF decompression regressed by nearly 12% too, the size of all Debian packages increased by about 6% with an -O3 optimization default, and the size of the desktop ISO increased by just under 4%.

On the Ubuntu Discourse they summed up their findings and concluded with:
"Distro-wide O3 does not seem to provide better performance and regresses it in interactive tasks. It affects load times by up to 11.9% which is detrimental to container workloads that strive for fast application startup.

Overall, this regression is mostly caused by the increase in the executable size. In addition, in some situations -O3 and Link Time Optimization together can result in excessive function inlining which then in turn regresses performance (presumably through register pressure or instruction cache thrashing).

It is fair to say that all of this is inline with conventional wisdom: -O3 can help in some situations but is not a sensible default. But it is definitely better to verify this than just rely on folk knowledge! In addition we still want to investigate more ways to improve the performance of Ubuntu, and each time we exercise our benchmarking muscles we will get better at it."

At least they will still explore selectively enabling -O3 optimizations for some packages where it makes sense with justifiable performance benefits.

👁 Ubuntu 25.04 beta


Ubuntu 25.04 is due for release in mid-April and does bring some other performance benefits while more performance tests are ongoing.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.