-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Closed
Copy link
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.
Description
I noticed my project https://github.com/matthiaskrgr/cargo-cache took noticeably longer to build with "lto=true" at some point.
I benchmarked link time (touch src/main.rs; cargo build --release) which appear to blow up as soon as we have several codegen units.
link times:
release | stable: 1.23 | beta: 1.24 | nightly: 1.25 |
---|---|---|---|
profile.release, lto=true, codegen-units=1 | 45s | 65s | 48s |
profile.release, lto=true | 46s | 278s | 244s |
profile.release (default) | 6.3s | 6.39 | 6.43s |
So it seem codegen-units=1 makes for bad parallelism while building but speeds up lto because less translation units need to be merged.
Maybe it is possible to dynamically use as little codegen units as possible (but still enough to utilize all cores) when building? //cc #46910
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.