Consistent Link-Time Optimization (LTO) usage across Pop!_OS repos #3386
zamazan4ik
started this conversation in
Ideas
Replies: 1 comment 7 replies
-
If it's already enabled in some repos, you're welcome to open PRs in the repos where it's not, and engineering and QA can take a look at if it's alright to enable. system76-power is far older than any of the COSMIC repos, so if this is a case of best practices having changed, then older repos may simply not have been updated with it yet. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I noticed that in the
Cargo.toml
file Link-Time Optimization (LTO) for the project is not enabled. I suggest switching it on since it will reduce the binary size (always a good thing to have) and will likely improve the application's performance a bit.I suggest enabling LTO only for the Release builds so as not to sacrifice the developers' experience while working on the project since LTO consumes an additional amount of time to finish the compilation routine. If you think that a regular Release build should not be affected by such a change as well, then I suggest adding an additional
dist
orrelease-lto
profile where additionally to regularrelease
optimizations LTO will also be added. Such a change simplifies life for maintainers and others interested in the project persons who want to build the most performant version of the application. Using ThinLTO should also help to reduce the build-time overhead with LTO.Basically, it can be enabled with the following lines:
I checked multiple pop_os projects and found that LTO is not consistently used across projects. For some of them (like cosmic-applibrary or cosmic-panel) LTO is enabled. For others like system76-power - it isn't. I propose enabling LTO in all pop_os projects for the Release (or a dedicated) profile. And only for projects where it has huge limitations (like triggering a compiler error) disable it. I expect that only for a few projects we can meet such problems.
Users who have build issues with LTO like increased memory consumption also will be able to easily switch off LTO in their specific cases (or just reduce the amount of parallel compilation jobs).
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions