-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A question about disabled LTO #24
Comments
Hey! You are right, I disabled it to reduce build times during development. The trace-deck performs poorly for large traces in debug builds, thus it can be useful to use release builds during development. However, It should probably enabled for the default release profile, I am not quite sure why the default release profile has it disabled. The main reason I commented it out was that in workspaces, you can only define them in the workspace Cargo file and not in individual packages and I don't want to overwrite any default behavior for the library crates (I am also not sure if it works that way, I could not find any information). I will need to have a look at other binary crates to see how they are doing it. Does this actually cause a problem on your site (aside from binary size/performance) or was this question more out of curiosity? |
If you want to use Release builds during the development phase but cannot afford using LTO in it due to increased compile times, I can suggest create an additional Cargo profile like
There are some ongoing discussions about different ways of how LTO can be enabled by default in Cargo but there are some blockers (some of them - the increased build time for the Release profile that can affect users). Since Cargo devs don't want to make such a decisions on behalf of all users, for now this decision is left to the applications devs.
Cargo will use LTO (and other) settings of the root Cargo file. So if you enable LTO here, and some other person will use
I have some statistics about that since I enabled LTO recently for many Rust binary crates. Almost all of them after my "missing LTO report" enable LTO for the Release profile.
For the |
Hi!
Recently I found that LTO is disabled for some reason in the Release profile: https://github.com/soehrl/tracing-tape/blob/main/Cargo.toml#L16 . Could you please elaborate a bit on the reason for this? I performed quick local tests (Fedora 41, Rust 1.82):
lto = true
the binary size from 13 Mib to 9.9 Mib. If you disabled it due to increased build time concerns, I guess we can enable LTO in a dedicated Cargo profile, smth like[profile.heavy-release]
.Thank you.
The text was updated successfully, but these errors were encountered: