add a deep fast_reject routine by lcnr · Pull Request #97345 · rust-lang/rust ·...
source link: https://github.com/rust-lang/rust/pull/97345
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
add a deep fast_reject routine #97345
Conversation
Contributor
lcnr commented 9 days ago
continues the work on #97136.
r? @nnethercote
Actually agree with you on the match structure let's see how that impacted perf
added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label
added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label
Contributor
Author
lcnr commented 9 days ago
Collaborator
rust-timer commented 9 days ago
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Contributor
bors commented 9 days ago
Contributor
Author
lcnr commented 9 days ago
Collaborator
rust-timer commented 9 days ago
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Contributor
bors commented 9 days ago
Contributor
Author
lcnr commented 9 days ago
@bors abort |
This comment has been minimized.
Contributor
bors commented 9 days ago
Try build successful - checks-actions |
Collaborator
rust-timer commented 9 days ago
Collaborator
rust-timer commented 9 days ago
Finished benchmarking commit (b1f8b07): 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
|
removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label
Contributor
Author
lcnr commented 9 days ago
ideally we extend that deep fast reject to also use it for coherence. That should probably give us some further speedups For that we need a deep fast reject where both sides are inference vars, implementing that now |
Contributor
Author
lcnr commented 9 days ago
Collaborator
rust-timer commented 9 days ago
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Contributor
bors commented 9 days ago
Contributor
Author
lcnr commented 9 days ago
Collaborator
rust-timer commented 9 days ago
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Contributor
Author
lcnr commented 9 days ago
Contributor
jackh726 commented 8 days ago
So, why does |
Contributor
nnethercote commented 8 days ago
It has a type This Zulip thread has more details. |
ty::Adt(obl_def, obl_substs) => match k { |
||
&ty::Adt(impl_def, impl_substs) => { |
||
obl_def == impl_def |
||
&& iter::zip(obl_substs, impl_substs) |
I guess if obl_def == impl_def
then the substs are guaranteed to have the same length?
Contributor
Author
lcnr 8 days ago
} |
||
_ => false, |
||
}, |
||
ty::Slice(obl_ty) => matches!(k, &ty::Slice(impl_ty) if types_may_unify(obl_ty, impl_ty)), |
You could use matches!
-with-an-if
in more of these cases... probably good to have consistency one way or the other. Since this is the only one at the moment, maybe a match
would be better here?
Contributor
Author
lcnr 8 days ago
my issue with matches is that it somewhat breaks formatting which is annoying.
Making this consistent is a bit annoying going to keep it this way for now '^^
// Ideally we would walk the existential predicates here or at least |
||
// compare their length. But considering that the relevant `Relate` impl |
||
// actually sorts and deduplicates these, that doesn't work. |
||
matches!(k, ty::Dynamic(impl_preds, ..) if |
Oh, this one is a matches!
too.
Contributor
nnethercote commented 8 days ago
Great additional improvements on Even better, I measured with a trunk version of The changes mostly look good. I have a few nits above, I'll let you decide how to deal with them. But please squash together commits 1, 3, and 4 before merging. |
Contributor
nnethercote commented 8 days ago
@bors delegate=lcnr |
Contributor
bors commented 8 days ago
@lcnr can now approve this pull request |
Contributor
nnethercote commented 8 days ago
I measured some benchmarks that we know from this analysis have some similarities to
Instruction counts measured locally for
|
This comment has been minimized.
Contributor
Author
lcnr commented 8 days ago
@bors r=nnethercote |
Contributor
bors commented 8 days ago
Commit bff7b51 has been approved by |
added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Contributor
bors commented 8 days ago
Contributor
bors commented 8 days ago
Test successful - checks-actions |
Collaborator
rust-timer commented 8 days ago
Finished benchmarking commit (4a99c5f): 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
|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK