-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
cleanup bound variable handling #97648
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 1f034249b78c28e3af4386ec181270785d3f2e27 with merge 764220f5017763a43ddc644fcece3f0c0054228c... |
r=me with clean perf |
☀️ Try build successful - checks-actions |
Queued 764220f5017763a43ddc644fcece3f0c0054228c with parent 5e6bb83, future comparison URL. |
Finished benchmarking commit (764220f5017763a43ddc644fcece3f0c0054228c): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 Footnotes |
@@ -76,21 +83,25 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { | |||
// (i.e., if there are no placeholders). | |||
let next_universe = self.universe().next_universe(); | |||
|
|||
let replaced_bound_var = Cell::new(false); |
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 wouldn't be surprised if this is the cause of the perf regression.
8cb0a81
to
6b1affc
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 6b1affc8eee5f2cdda28f147f3d5afa5376afa84 with merge 334a9e57d7951e2e681a8459304b8add7519138e... |
☀️ Try build successful - checks-actions |
Queued 334a9e57d7951e2e681a8459304b8add7519138e with parent 09d52bc, future comparison URL. |
Finished benchmarking commit (334a9e57d7951e2e681a8459304b8add7519138e): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 Footnotes |
☀️ Try build successful - checks-actions |
Queued 86aca0894812c777883f063244a3e238a38aadc0 with parent 52ee2a2, future comparison URL. |
Finished benchmarking commit (86aca0894812c777883f063244a3e238a38aadc0): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 Footnotes |
return inner; | ||
} | ||
|
||
let mut region_map = FxHashMap::default(); |
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.
it looks like the perf regression is caused by this code being pretty hot and us always creating 3 separate storages here and then having to drop them.
Went from BTreeMap
-> SsoHashMap
-> FxHashMap
to figure out if these help. The more complex Drop
impl (and greater size) of SsoHashMap
made things worse. So hopefully the comparatively simple HashMap
ends up being an improvement.
If not I think we should commit to tracking bound vars in binders and modify this to eagerly create a Vec
of inference vars using value.bound_vars()
and then using that. Doing so should allow us to get some perf improvements in other areas as well.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit efdf948 with merge b1d9f0069e496cbc091da1b5e708140a8b6c7da6... |
☀️ Try build successful - checks-actions |
Queued b1d9f0069e496cbc091da1b5e708140a8b6c7da6 with parent f19ccc2, future comparison URL. |
Finished benchmarking commit (b1d9f0069e496cbc091da1b5e708140a8b6c7da6): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 Footnotes |
perf is pretty stupid 🤷 whatever @bors r=jackh726 |
📌 Commit efdf948 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (75307c2): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
@rustbot label: +perf-regression-triaged. |
each commit should be pretty self-contained and hopefully straightforward to review.
I've added 677ec23a8dbf8ff5f1c03ccebd46f8b85e5ec1fc so that we can stop returning the region map from
replace_bound_vars_with_fresh_vars
in the following commit.r? @nikomatsakis or @jackh726