-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Compile some CGUs in parallel at the start of codegen #67889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with nits addressed.
I hope we really can get rid of OnGoingCodegen
entirely at some point.
Heads up, @bjorn3: This PR changes the codegen backend protocol. |
Thanks for the ping @michaelwoerister! This is in a part which I don't yet use though. Because cranelift-module compiles a function as soon as you define it, isn't possible for me to use multiple threads until there are parallel rustc builds for every nightly. |
☔ The latest upstream changes (presumably #67886) made this pull request unmergeable. Please resolve the merge conflicts. |
This looks like a nice small improvement! In the limit I'm looking forward to when we can fully reap the benefits here, including:
I don't think we can get here until we remove the single-threaded compiler completely though. While this is adding complexity to an already complex backend it's not too too bad and has some modest wins. I think the biggest wins though are going to come when we're able to remove the coordinator thread entirely. |
Thanks, @Zoxc. @bors r+ I'm r+ing under the assumption that the job server questions is resolved to @Mark-Simulacrum's and @alexcrichton's satisfaction. I don't know the details there. |
📌 Commit e3a36c0d78c69ea59a6bde4bae0729dc3545a7b4 has been approved by |
☔ The latest upstream changes (presumably #67988) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=michaelwoerister |
📌 Commit 69bacd0 has been approved by |
Compile some CGUs in parallel at the start of codegen This brings the compilation time for `syntex_syntax` from 11.542s to 10.453s with 6 threads in non-incremental debug mode. Just compiling `n` CGUs in parallel at the beginning of codegen seems sufficient to get rid of the staircase effect, at least for `syntex_syntax`. Based on rust-lang#67777. r? @michaelwoerister cc @alexcrichton @Mark-Simulacrum
Compile some CGUs in parallel at the start of codegen This brings the compilation time for `syntex_syntax` from 11.542s to 10.453s with 6 threads in non-incremental debug mode. Just compiling `n` CGUs in parallel at the beginning of codegen seems sufficient to get rid of the staircase effect, at least for `syntex_syntax`. Based on rust-lang#67777. r? @michaelwoerister cc @alexcrichton @Mark-Simulacrum
Rollup of 9 pull requests Successful merges: - #67000 (Promote references to constants instead of statics) - #67756 (Collector tweaks) - #67889 (Compile some CGUs in parallel at the start of codegen) - #67930 (Rename Result::as_deref_ok to as_deref) - #68018 (feature_gate: Remove `GateStrength`) - #68070 (clean up E0185 explanation) - #68072 (Fix ICE #68058) - #68114 (Don't require `allow_internal_unstable` unless `staged_api` is enabled.) - #68120 (Ban `...X` pats, harden tests, and improve diagnostics) Failed merges: r? @ghost
Compile some CGUs in parallel at the start of codegen This brings the compilation time for `syntex_syntax` from 11.542s to 10.453s with 6 threads in non-incremental debug mode. Just compiling `n` CGUs in parallel at the beginning of codegen seems sufficient to get rid of the staircase effect, at least for `syntex_syntax`. Based on rust-lang#67777. r? @michaelwoerister cc @alexcrichton @Mark-Simulacrum
Rollup of 8 pull requests Successful merges: - #67756 (Collector tweaks) - #67889 (Compile some CGUs in parallel at the start of codegen) - #67930 (Rename Result::as_deref_ok to as_deref) - #68018 (feature_gate: Remove `GateStrength`) - #68070 (clean up E0185 explanation) - #68072 (Fix ICE #68058) - #68114 (Don't require `allow_internal_unstable` unless `staged_api` is enabled.) - #68120 (Ban `...X` pats, harden tests, and improve diagnostics) Failed merges: r? @ghost
This brings the compilation time for
syntex_syntax
from 11.542s to 10.453s with 6 threads in non-incremental debug mode. Just compilingn
CGUs in parallel at the beginning of codegen seems sufficient to get rid of the staircase effect, at least forsyntex_syntax
.Based on #67777.
r? @michaelwoerister
cc @alexcrichton @Mark-Simulacrum