Trying Out The Ubuntu "-O3" Optimized Build For Greater Performance

Written by Michael Larabel in Operating Systems on 5 August 2024 at 12:30 PM EDT. Page 1 of 5. 46 Comments.

Canonical engineers on Friday announced they are evaluating "-O3" compiler optimized package builds for Ubuntu Linux. As part of this evaluation of using GCC's -O3 compiler optimization level rather than -O2 when compiling Ubuntu packages, experimental Ubuntu desktop and server ISOs are available for testing with this change. Excitingly I ran some initial benchmarks over the weekend in looking at the performance difference.

Ubuntu -O3 experimental build

Canonical hasn't decided if they will be switching to the "-O3" compiler optimization level by default moving forward but it's great they are evaluating it... Hopefully they decide to do so or at least for the subset of Ubuntu packages that are very performance sensitive and can benefit from the more aggressive compiler optimization level.

In being curious about the impact across some different workloads, I ran some benchmarks of Ubuntu 24.04 LTS installed cleanly out-of-the-box and then again repeating the clean Ubuntu 24.04 LTS install but using the -O3 built ISOs. The testing was all done from a System76 Thelio workstation powered by the AMD Ryzen Threadripper 7980X.

Ubuntu -O3 Optimized Benchmarks

Besides the packages on the experimental ISOs being -O3 built, the APT repository setup on these ISOs point to their testing archive containing the -O3 optimized packages. So installing new Debian packages and the like atop the install will also fetch packages from that -O3 archive rather than the official/default Ubuntu archive.

I ran a variety of benchmarks using the Ubuntu packages to see the difference of the -O3 package builds.

Related Articles