News: 0001537284

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

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

([Ubuntu] 23 Minutes Ago No -O3 Everywhere)


Since last year Canonical had been [1]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 [2]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 [3]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 is due for release in mid-April and does bring [4]some other performance benefits while more performance tests are ongoing.



[1] https://www.phoronix.com/news/Ubuntu-Evaluating-O3-Optimized

[2] https://www.phoronix.com/news/Ubuntu-No-O3-Easier-ARM64

[3] https://discourse.ubuntu.com/t/benchmarking-a-distribution-and-some-o3-results/58027

[4] https://www.phoronix.com/review/ubuntu-2504-beta-benchmarks



phoronix

Wad some power the giftie gie us
To see oursels as others see us.
-- R. Burns