-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use if SHARDS == 1
in a couple more places.
#94111
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
Conversation
It's already used in `get_shard_by_value`, doesn't hurt to add it in a couple of related functions for consistency.
I got a miniscule win from this locally, let's see how CI looks. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 5563b36 with merge 1e3f3d2d4ce19371443dde82cdd1d32c9169766b... |
☀️ Try build successful - checks-actions |
Queued 1e3f3d2d4ce19371443dde82cdd1d32c9169766b with parent 73a7423, future comparison URL. |
// hashbrown also uses the lowest bits, so we can't use those | ||
let bits = (hash >> (hash_len * 8 - 7 - SHARD_BITS)) as usize; | ||
bits % SHARDS | ||
if SHARDS == 1 { |
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.
https://godbolt.org/z/cq9nMvz1q This change is maybe redudant, since the optimizer will see that bits % 1
has to equal zero?
Cc #94084 - which drops sharding totally (at least for non parallel) |
Finished benchmarking commit (1e3f3d2d4ce19371443dde82cdd1d32c9169766b): comparison url. Summary: This benchmark run did not return any relevant results. 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 led to changes in compiler perf. @bors rollup=never |
It drops sharding for query caches, but not for interning. |
This didn't end up being interesting, and #94084 is a more comprehensive possibility. |
It's already used in
get_shard_by_value
, doesn't hurt to add it in acouple of related functions for consistency.
r? @ghost