-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-ltoArea: link-time optimizationArea: link-time optimization
Description
Comparing these two commands building Cargo itself with lto='thin'
:
cargo build --release
cargo build --release --bin cargo
The first command does not engage the LTO codegen optimization added in #8192. On my system, the total build time goes from 187s to 150s.
It is a bit surprising, since the two commands generally produce the same output, so I would not expect them to use different settings.
Would it make sense to be a little smarter about how the root units are chosen? I think the crux of the issue is this line where it starts the lib at Lto::None
in the first case. In the second case, it is computed as a dependency with Lto::OnlyBitcode
.
Metadata
Metadata
Assignees
Labels
A-ltoArea: link-time optimizationArea: link-time optimization