Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

nnethercote
Copy link
Contributor

It's already used in get_shard_by_value, doesn't hurt to add it in a
couple of related functions for consistency.

r? @ghost

It's already used in `get_shard_by_value`, doesn't hurt to add it in a
couple of related functions for consistency.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 18, 2022
@nnethercote
Copy link
Contributor Author

I got a miniscule win from this locally, let's see how CI looks.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 18, 2022
@bors
Copy link
Collaborator

bors commented Feb 18, 2022

⌛ Trying commit 5563b36 with merge 1e3f3d2d4ce19371443dde82cdd1d32c9169766b...

@bors
Copy link
Collaborator

bors commented Feb 18, 2022

☀️ Try build successful - checks-actions
Build commit: 1e3f3d2d4ce19371443dde82cdd1d32c9169766b (1e3f3d2d4ce19371443dde82cdd1d32c9169766b)

@rust-timer
Copy link
Collaborator

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 {
Copy link
Contributor

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?

@Mark-Simulacrum
Copy link
Member

Cc #94084 - which drops sharding totally (at least for non parallel)

@rust-timer
Copy link
Collaborator

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
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 18, 2022
@nnethercote
Copy link
Contributor Author

Cc #94084 - which drops sharding totally (at least for non parallel)

It drops sharding for query caches, but not for interning.

@nnethercote
Copy link
Contributor Author

This didn't end up being interesting, and #94084 is a more comprehensive possibility.

@nnethercote nnethercote deleted the shard-consistency branch February 19, 2022 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants