-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Better sso structures #77171
Better sso structures #77171
Conversation
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 1046efb1dd1e7739fea89f4717b64ede06478647 with merge 756b88018c71526ac1998d6368cd4886d88cdb73... |
I'll review in a bit, but let's launch perfbot in parallel |
☀️ Try build successful - checks-actions, checks-azure |
Queued 756b88018c71526ac1998d6368cd4886d88cdb73 with parent fadf025, future comparison URL. |
FYI, this try build might be a bit noisier or affected by more than just the PR itself, as we just applied some de-noising on the server. So it might make sense to re-create a try build, especially if perf is a blocking concern for whatever reason. |
/// PartialEq/Eq (requires sorting the array) | ||
/// BitOr/BitAnd/BitXor/Sub | ||
#[derive(Clone)] | ||
pub enum SsoHashSet<T> { |
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.
Why is this not just a wrapper struct around SsoHashMap<T, ()>
?
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.
That's actually a good idea.
Sure, it's already a thin wrap, but it could be even thinner.
Let me try that.
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.
Ah 😆 I thought there was a reason and just wanted it documented. Maybe let's do that in a separate step, since we already have a perf situation
Finished benchmarking try commit (756b88018c71526ac1998d6368cd4886d88cdb73): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Just to be sure that's not due to the recent perf changes: @bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 1046efb1dd1e7739fea89f4717b64ede06478647 with merge f42f07c1222f0c090836b569b9de3e508c571e1b... |
☀️ Try build successful - checks-actions, checks-azure |
Queued f42f07c1222f0c090836b569b9de3e508c571e1b with parent b984ef6, future comparison URL. |
Finished benchmarking try commit (f42f07c1222f0c090836b569b9de3e508c571e1b): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
So it's not noise. Typeck deserialization from incremental caches is affected |
I'm really surprised by the result. |
Maybe inlining changed? That can be very subtle and happen due to minor changes |
Hmm. I can't reproduce this result locally: Any suggestions? Here are the changes compared to previous version:
|
I can't tell from the code changes (where the map/set is used) how this could affect incremental cache loading times. I'm guessing it's all spurious. So, let's go with: rebase, change the set impl to just forward to the map impl, run perf again. Does that sound reasonable to you? |
Yup, let me do just that. |
It is a more descriptive name and with upcoming changes there will be nothing "mini" about them.
Now both provide almost complete API of their non-SSO counterparts.
ba13505
to
848cd2a
Compare
⌛ Trying commit 41942fa with merge f19b20c14696f331a43042bde62219a773d43ba4... |
☀️ Try build successful - checks-actions, checks-azure |
Queued f19b20c14696f331a43042bde62219a773d43ba4 with parent c9e5e6a, future comparison URL. |
Finished benchmarking try commit (f19b20c14696f331a43042bde62219a773d43ba4): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Sigh. Trying to reproduce it locally one more time. |
I reproduced it locally. Am I missing something? |
The only thing I can come up with is that this is not a regression in this PR, but this PR is just a symptom of a regression from the beta (bootstrap) compiler to master. So master doesn't optimize your changes as well as they were optimized on beta. Can you try this out by rebasing onto the master branch from just when the mini maps were introduced and rerunning perf on stage 2? Or is that not long enough ago to make a difference? cc @rust-lang/wg-compiler-performance @rust-lang/wg-codegen any ideas what's going on? do we have any perf regressions maybe due to an llvm upgrade or something? |
Yeah, they were introduced just recently. I think I narrowed it down. When I remove generality over I'm out good of ideas by now. What would be the best way to inspect assembly output sans for disassembling rust? |
|
Due to performance regression, see SsoHashMap comment.
Pushed a change. Removed |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit d1d2184 with merge 3580ee5afaa5d6dc265216653a63bdd35ebe828c... |
☀️ Try build successful - checks-actions, checks-azure |
Queued 3580ee5afaa5d6dc265216653a63bdd35ebe828c with parent efbaa41, future comparison URL. |
Finished benchmarking try commit (3580ee5afaa5d6dc265216653a63bdd35ebe828c): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
@bors r+ Thanks, this looks good now. Wrt the constant that decides the array size, you could make it a const generic parameter in a follow-up PR if you think making it configurable is useful per-site. |
📌 Commit d1d2184 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
This change greatly expands interface of MiniSet/MiniMap and renames them because they are no longer "Mini".