You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I profiled the building of my project using cargo +nightly rustc -- -Zself-profile. There's no --release so I assume it's going to do a dev build. Then, I run summarize summarize on the profiling file that was produced, and it lists as the very first item, therefore taking the most time:
+--------------------------------------------------+-----------+-----------------+----------+------------+
| Item | Self time | % of total time | Time | Item count |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_lto_optimize | 172.31s | 23.797 | 172.31s | 256 |
+--------------------------------------------------+-----------+-----------------+----------+------------+
This is unexpected, because LTO is explicitly disabled in the dev profile. I'm assuming that opt-level = 2 simply includes LTO by default, but then why am I not able to override it?
Hi! The profile setting lto = false still does "thin local LTO" when the opt-level is not zero, which is LTO on the local crate across codegen units. To fully disable LTO, the setting needs to be lto = "off". There's more info in the docs. I realize that might be a little confusing (there is rust-lang/cargo#7491 filed for this), but that is how things evolved over time.
My project has the following profile settings in the
Cargo.toml
:I profiled the building of my project using
cargo +nightly rustc -- -Zself-profile
. There's no--release
so I assume it's going to do a dev build. Then, I runsummarize summarize
on the profiling file that was produced, and it lists as the very first item, therefore taking the most time:This is unexpected, because LTO is explicitly disabled in the dev profile. I'm assuming that
opt-level = 2
simply includes LTO by default, but then why am I not able to override it?rustc --version --verbose
:The text was updated successfully, but these errors were encountered: