-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Micro-optimize ty::relate::relate_substs
by avoiding match
#96020
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 16a91de2b22a1a01621a8fe074a97ace032341f5 with merge d32a84628f120a8b1aaedc3b83535b149f696e07... |
☀️ Try build successful - checks-actions |
Queued d32a84628f120a8b1aaedc3b83535b149f696e07 with parent 0d13f6a, future comparison URL. |
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.
Faster and simpler, always a good combination :)
I have a couple of minor questions and comments, but none of them will block this. Looking good.
Finished benchmarking commit (d32a84628f120a8b1aaedc3b83535b149f696e07): comparison url. Summary:
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 |
The |
Ah my bad, I didn't consider the case where
I'll re-add the cache and we can do a new perf run. |
There was no need to keep doing the match inside the iterator.
16a91de
to
041121a
Compare
Amended the commit now, should be an improvement over not using a cache: Primary benchmarks
Secondary benchmarks
I also tried adding a fast return
with the above patch, but the local results, while improved for
|
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 041121a with merge 60fe9fdfb1584b34704021611324acb33c5dc472... |
☀️ Try build successful - checks-actions |
Queued 60fe9fdfb1584b34704021611324acb33c5dc472 with parent 2fa9789, future comparison URL. |
Finished benchmarking commit (60fe9fdfb1584b34704021611324acb33c5dc472): comparison url. Summary:
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 |
One for the case with variances, and one without. All callers use an explicit Option for the variable anyway.
Finished benchmarking commit (114440f4e7b9ec843d38a79631c132534ed409c2): comparison url. Summary:
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 |
I did some local measurements, everything was improved or unchanged:
|
If you click on a percent change result for a single benchmark run you end up at a page like this one. That gives some
This isn't really related to your change. |
I'm going to approve this, based on the following:
@martingms: once this merges, we should do another CI perf run for #96022. @bors r+ |
📌 Commit 19dedf3 has been approved by |
⌛ Testing commit 19dedf3 with merge eea74015f20022c0cfc414b8ed9ecdb2eb0197e7... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c102c5c): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
Was a top-20 hot function in a callgrind profile of compiling
bitmaps-3.1.0
.Yields some small speedups on that crate and some others according to local benching:
r? @nnethercote