Consider enabling more aggressive optimizations like Fat LTO and codegen-units = 1 for Release profile #968
-
Hi! I see that the project already uses ThinLTO in the Release profile in the root If enabling Fat LTO is considered to "heavy" for the default Release profile, we can prepare one more profile like Basically, it can be enabled with the following change:
I have made quick local tests (Fedora 41, Rust 1.84, the latest version of this project at the moment) - the results are below. I show only binary size changes since it's easier to measure them compared to performance differences in this app.
Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hey, so I think these settings are more of a distro thing to set? For example, here's Fedora RPM macros making their own profile with all of these settings: https://pagure.io/fedora-rust/rust-packaging/blob/main/f/macros.d/macros.cargo#_88 So my COPRs should already have them all enabled. I build the default release profile quite often for development and testing, so it should stay reasonably fast to build. Last time I tried fat LTO + codegen-units = 1, it took waaaaay longer. And preparing a separate profile seems somewhat unnecessary given that distros should already override it as they see fit. |
Beta Was this translation helpful? Give feedback.
-
Hi @YaLTeR my distro is LFS, and I install Rust software using |
Beta Was this translation helpful? Give feedback.
Hm. Maybe they missed it? Other settings seem there, like codegen-units = 1 and opt-level = 3.
Heh, I went to look it up and found your own question: https://discussion.fedoraproject.org/t/link-time-optimization-lto-for-rust-packages-by-default-in-fedora/140086
Not sure applications should be responsible for this particular kind of distro issue.