-
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
Store VariantIdx to distinguish enum variants #85195
Conversation
This saves ~24% of the instructions on the match-stress-enum benchmark.
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue The only PartialEq user is here, but it's not quite clear if that compares across enums ever.
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit e400595 with merge 8dc9aa2668caece29926c3444fa73fdeda459f27... |
☀️ Try build successful - checks-actions |
Queued 8dc9aa2668caece29926c3444fa73fdeda459f27 with parent ba8d7e2, future comparison URL. |
Finished benchmarking try commit (8dc9aa2668caece29926c3444fa73fdeda459f27): 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 |
Cc @Nadrieril |
That's fine, typechecking ensures we only ever compare |
@bors r+ |
📌 Commit e400595 has been approved by |
☀️ Test successful - checks-actions |
This saves ~24% of the instructions on the match-stress-enum benchmark, but I'm not 100% sure that this is OK - if we ever compare two constructors across enums (e.g., a Result and an Option), then this is obviously insufficient; I can experiment with continuing to store the DefId for comparison purposes in that case.