Mesa Developers Discuss LTO'ing + PGO'ing Builds For Greater Performance

Written by Michael Larabel in Mesa on 13 February 2020 at 06:23 AM EST. 43 Comments
Making use of Link-Time Optimizations (LTO) and Profile Guided Optimizations (PGO) is currently being talked about by Mesa developers for their release builds in potentially squeezing out better performance.

Dieter N├╝tzel shared that when using LTO and PGO compiler optimizations on Mesa, he's able to get RadeonSI's binary size 40% smaller and 16~20% faster for this OpenGL driver. Link-time optimizations are about as the name implies running optimization passes during the linker phase when able to analyze the to-be-produced binary in full rather than the individual object files in order to allow for more inter-procedural optimizations on the whole program.

Profile guided optimizations entail first creating a tentative build with special instrumentation, running that build while collecting samples to analyze hot/cold code-paths, etc, and then to provide that feedback to the compiler in order for it to better optimize the actual final build based upon that (ideally real-world) profile information. PGO'ing binaries can generally be a significant help for performance assuming the collected profiles are accurate.

LTO+PGO helps the likes of Mozilla Firefox release builds already, Clear Linux optimizations, and more. Mesa developers are loosely talking about whether they could employ these optimizations for allowing faster release builds.

The barrier for LTO'ing is relatively low but for PGO'ing they would need to be running various OpenGL and Vulkan applications during the build process in order for generating the profile data. That becomes more complicated with the different drivers and given the wide nature of graphics APIs and software/games difficult to ensure the PGO data is accurate enough to help out all users.

Anyhow, it will be interesting to see where this discussion leads and if at least in the short-term they recommend LTO optimizations and in the longer-term they can come up with a sane approach for PGO'ing Mesa.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of 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 automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week