-
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
Increase parallelism in various locations #115003
base: master
Are you sure you want to change the base?
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
@@ -757,14 +757,28 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { | |||
CStore::from_tcx(tcx).report_unused_deps(tcx); | |||
}, | |||
{ | |||
// Prefetch this as it is used later by the loop below | |||
// to prevent multiple threads from blocking on it. | |||
let _ = tcx.get_lang_items(()); |
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.
Can this be fixed in query infra, yielding control to another job if blocked on another query?
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.
Somewhat by using a thread pool with fibers. That's not a short term fix and it's not free, so we might want to keep these anyway.
// FIXME: Remove this when we implement creating `DefId`s | ||
// for anon constants during their parents' typeck. | ||
// Typeck all body owners in parallel will produce queries | ||
// cycle errors because it may typeck on anon constants directly. |
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.
Is the cycle issue fixed?
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.
This PR just moves this code. It shouldn't have any effect on any cycle issue.
@@ -805,7 +805,8 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { | |||
sess.time("misc_checking_2", || { | |||
parallel!( | |||
{ | |||
tcx.ensure().effective_visibilities(()); | |||
// Prefetch this as it is used later by lint checking and privacy checking. | |||
let _ = tcx.effective_visibilities(()); |
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.
Why isn't the ensure
enough? effective_visibilities
is eval_always.
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.
I've changed all the prefetching to use ensure_with_value
. It's nicer than having to rely on queries being eval_always
which might possibly change.
self.reference.bget(index).map(&self.closure) | ||
//~^ ERROR unconstrained generic constant | ||
//~| ERROR mismatched types |
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.
Where do the additional diags come from?
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.
Compilation no long immediately stops on fatal errors and instead wait for all parallel executions to be complete. The serial compiler simulates this behavior to ensure test outputs match.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit f9d12e2a6022cbbed60f458a78502791ec77ccef with merge 5f30bb0cbc3842d6520bacf4d7dea860e138c4d9... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
f9d12e2
to
1821289
Compare
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (5f30bb0cbc3842d6520bacf4d7dea860e138c4d9): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 636.001s -> 635.653s (-0.05%) |
1821289
to
d125a5d
Compare
I avoided prefetching of |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit d125a5d8c1dc23342aa5641675df34d33a76958f with merge 78a3877375fe23c25e4c0ea3ff01b84d806cd35d... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (78a3877375fe23c25e4c0ea3ff01b84d806cd35d): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 636.195s -> 635.468s (-0.11%) |
☔ The latest upstream changes (presumably #115226) made this pull request unmergeable. Please resolve the merge conflicts. |
adf2a24
to
a84acd2
Compare
This comment has been minimized.
This comment has been minimized.
a84acd2
to
8c94f1f
Compare
☔ The latest upstream changes (presumably #115144) made this pull request unmergeable. Please resolve the merge conflicts. |
8c94f1f
to
7d9bf5a
Compare
This comment has been minimized.
This comment has been minimized.
7d9bf5a
to
946b97d
Compare
This comment has been minimized.
This comment has been minimized.
946b97d
to
8747443
Compare
☔ The latest upstream changes (presumably #115401) made this pull request unmergeable. Please resolve the merge conflicts. |
8747443
to
dc4688b
Compare
This comment has been minimized.
This comment has been minimized.
dc4688b
to
e26db41
Compare
This comment has been minimized.
This comment has been minimized.
e26db41
to
a07cb22
Compare
☔ The latest upstream changes (presumably #116482) made this pull request unmergeable. Please resolve the merge conflicts. |
a07cb22
to
ec1df88
Compare
☔ The latest upstream changes (presumably #120112) made this pull request unmergeable. Please resolve the merge conflicts. |
ec1df88
to
01ae9a3
Compare
☔ The latest upstream changes (presumably #121154) made this pull request unmergeable. Please resolve the merge conflicts. |
@Zoxc Any updates on this? Thanks |
You can probably consider this blocked on rust-lang/rustc-rayon#12. |
This is a rebase of #67870 which consists of various additions of parallelism in the compiler.
Performance improvement for the parallel compiler with 6 threads:
cc @SparrowLii