-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
The rustc_query_impl crate is too big, which hurts compile times for the compiler itself #65031
Copy link
Copy link
Open
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustA-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)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.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustA-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)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.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
EDIT(Centril): The crate was renamed to
rustc_middlein #70536.EDIT(jyn514): Most of rustc_middle was split into
rustc_query_implin #70951.The results from @ehuss's new

cargo -Ztimingsfeature really drive home how the size of therustccrate hurts compile times for the compiler. Here's a picture:Things to note.
rustccrate takes about twice as long to compile as therustc_mircrate, which is the second-biggest crate.rustccrate's codegen is happening. (Thank goodness for pipelining, it really makes a difference in this case.)rustccrate without anything else happening in parallel (from 42-67s, and from 141-174s).Also, even doing
checkbuilds onrustccode is painful. On my fast 28-core Linux box it takes 10-15 seconds even for the first compile error to come up. This is much longer than other crates. Refactorings within therustccrate that require many edit/compile cycles are painful.I've been told that
rustcis quite tangled and splitting it up could be difficult. That may well be true. The good news is that the picture shows we don't need to split it into 10 equal-sized pieces to get benefits. Even splitting off small chunks into separate crates will have an outsized effect on compilation times.