Fast-path some relations via strict equality#104598
Fast-path some relations via strict equality#104598compiler-errors wants to merge 2 commits intorust-lang:masterfrom
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
|
⌛ Trying commit 3a5bf11 with merge bf7cfa7141d188772c184387e27cc0505b3dcc5c... |
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (bf7cfa7141d188772c184387e27cc0505b3dcc5c): comparison URL. Overall result: ✅ improvements - 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.
|
|
|
||
| fn fast_equate_combine(&self) -> bool { | ||
| true | ||
| } | ||
|
|
There was a problem hiding this comment.
should these be marked #[inline]?
There was a problem hiding this comment.
perhaps that would help... 🤔
|
I'll try one more perf run, but unclear that this is worth the complexity... @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
|
⌛ Trying commit d1ed286 with merge aff588effced4b8915a1406ff5b4271169c1181a... |
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (aff588effced4b8915a1406ff5b4271169c1181a): comparison URL. Overall result: ✅ improvements - 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.
|
|
|
||
| /// Returns whether or not structural equality can be used to fast-path this relation | ||
| fn fast_equate_combine(&self) -> bool; | ||
| fn fast_equate(&self) -> bool; |
There was a problem hiding this comment.
Annotate inline this declaration instead?
There was a problem hiding this comment.
#[inline] means nothing on trait methods without a body.
|
Is this confirmed to fix #104583? I don't think the perf is enough of a win to justify to added complexity otherwise. If we want to land this, I think every one of the Also, can just make a default method with false, and only add an impl method for true. |
Yes, though I can probably reformulate this to be simpler, given that we don't have a perf win in general. Let me close this and go back to the drawing board. |
…, r=oli-obk Fast-path some binder relations A simpler approach than rust-lang#104598 Fixes rust-lang#104583 r? types
Some relations can take advantage of strict equality (that is, the
==operator), which is far cheaper to check in some cases like substs and existential predicate lists.This also fixes #104583.
r? @ghost