Ubuntu 21.04 Moves Ahead With Enabling LTO Optimizations For Greater Performance
Back in January the plans were discussed for Ubuntu enabling LTO optimizations for packages with Ubuntu 21.04 to yield greater performance by allowing additional compiler optimizations at link-time on the entire binary. This follows the likes of Fedora and openSUSE already employing LTO by default as part of their package builds.
While into the Ubuntu 21.04 feature freeze and just one month out from release, this LTO enablement is finally happening for the Hirsute Hippo.
Uploaded this week was the latest dpkg package that now turns on LTO optimizations. Link-time optimizations are enabled by default for x86_64 (AMD64), ARM64, PPC64EL, and s390x architectures where GCC LTO support is reliable and generally a worthwhile performance improvement.
Matthias Klose further commented on the mailing list for the current state and the plan on black-listing packages that have build issues or other problems with LTO:
This is now turned on by default, a bit later than expected (discussed and approved by Lukasz). The package lto-disabled-list is now seeded with all packages not in main, which regressed with LTO optimizations for some reason.
For the ~80 regressing packages in main, I'll do uploads after the next test rebuild planned for next week, either fixing the regression, or turning off LTO optimizations directly in the package.
Great to see this happening and should help the default GCC 10 compiler on Ubuntu 21.04 help squeeze some extra performance out of the system. Ubuntu 21.04 benchmarks will be heating up on Phoronix in the weeks ahead.