Uh oh!
There was an error while loading. Please reload this page.
Use FxHashSet instead of Vec for well formed tys - #88771
Conversation
jackh726
commented
Sep 9, 2021
@bors try @rust-timer queue |
rust-timer
commented
Sep 9, 2021
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
bors
commented
Sep 9, 2021
⌛ Trying commit ba67d85ae338bbb4ab1b840e9bf57883cad1efdd with merge 05ee7be89fecd02defa835ceae7c6c57e8582a12... |
bors
commented
Sep 9, 2021
☀️ Try build successful - checks-actions |
rust-timer
commented
Sep 9, 2021
Queued 05ee7be89fecd02defa835ceae7c6c57e8582a12 with parent 626649f, future comparison URL. |
rust-timer
commented
Sep 9, 2021
Finished benchmarking commit (05ee7be89fecd02defa835ceae7c6c57e8582a12): comparison url. Summary: This change led to large relevant improvements 🎉 in compiler performance.
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 led to changes in compiler perf. @bors rollup=never |
jackh726
commented
Sep 9, 2021
@bors try @rust-timer queue |
rust-timer
commented
Sep 9, 2021
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
bors
commented
Sep 9, 2021
⌛ Trying commit 8e7613f with merge 4508123e015a7afc057ce1b1b417413dc7c45059... |
bors
commented
Sep 9, 2021
☀️ Try build successful - checks-actions |
rust-timer
commented
Sep 9, 2021
Queued 4508123e015a7afc057ce1b1b417413dc7c45059 with parent 497ee32, future comparison URL. |
rust-timer
commented
Sep 9, 2021
Finished benchmarking commit (4508123e015a7afc057ce1b1b417413dc7c45059): comparison url. Summary: This change led to large relevant improvements 🎉 in compiler performance.
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 led to changes in compiler perf. @bors rollup=never |
jackh726
commented
Sep 9, 2021
Doesn't win back all the perf lost from #88312, but is better. I'm not sure that there's a way to win more perf without changing the approach completely. So, I think this is probably worth merging and accepting the difference. cc @rylev regarding perf r? rust-lang/compiler |
nikomatsakis
commented
Sep 10, 2021
@bors r+ |
bors
commented
Sep 10, 2021
📌 Commit 8e7613f has been approved by |
bors
commented
Sep 10, 2021
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
bors
commented
Sep 12, 2021
bors
commented
Sep 12, 2021
☀️ Test successful - checks-actions |
rust-timer
commented
Sep 12, 2021
Finished benchmarking commit (9ef27bf): comparison url. Summary: This change led to large relevant improvements 🎉 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
| fn_sig_tys: &[Ty<'tcx>], | ||
| fn_sig_tys: FxHashSet<Ty<'tcx>>, | ||
| body_id: hir::HirId, | ||
| span: Span, | ||
| ) { | ||
| debug!("add_implied_bounds()"); | ||
| for &ty in fn_sig_tys { | ||
| for ty in fn_sig_tys { |
There was a problem hiding this comment.
This is iterating on a FxHashSet<Ty<'tcx>>, which will depend on ASLR (random memory allocation order) and the results could be observable (e.g. potentially in diagnostics order).
I wonder if we should ban iterating FxHash{Set,Map} and force the use of FxIndex{Set,Map} instead (since presumably the insertion order is deterministic).
There was a problem hiding this comment.
See also #63713 (comment) - we should probably use internal lints to force this harder.
There was a problem hiding this comment.
we should ban iterating
FxHash{Set,Map}
YES! I think recommending FxIndex{Set,Map} is probably the right choice, using an internal lint when using a FxIndexSet in a potentially nondet way. Now if the order doesn't matter, e.g. checking for existence without any sideeffects, this lint could be explicitly allowed.
Not sure what's the best way to write such a lint though 😅
Trying to recover perf from #88312
r? @ghost