-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Remove chunk size from each chunk in ChunkedBitSet
.
#145480
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
base: master
Are you sure you want to change the base?
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Remove chunk size from each chunk in `ChunkedBitSet`.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We have an open PR on dense bitsets that removes the domain size as well (and one passes it in in the few cases where it’s needed; it’s usually easy to know where the bitsets are constructed and used) with good effects IIRC, it’s also something we could try on chunked bitsets. |
Finished benchmarking commit (acb05a6): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.8%, secondary -3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.8%, secondary 4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.7%, secondary -1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 469.562s -> 468.956s (-0.13%) |
8a28a3d
to
8fa6c55
Compare
@lqd do you have a link to the PR for dense bitsets? |
This comment has been minimized.
This comment has been minimized.
8fa6c55
to
e2f33ee
Compare
r? compiler |
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.
r=me with nits fixed (mostly the documentation, open either way on the last_chunk_size comment)
for (chunk_index, (mut self_chunk, other_chunk)) in | ||
self.chunks.iter_mut().zip(other.chunks.iter()).enumerate() | ||
{ | ||
let chunk_domain_size = if chunk_index + 1 == num_chunks { |
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.
Should this use self.chunk_domain_size(chunk_index)
? I guess that maybe doesn't cache the more complex computation (modulus, etc.) but that should only happen once per iteration, so maybe that's better (less register pressure etc)?
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.
We are mutably borrowing self.chunks
, so borrowck won't let us. And re-implementing is simple enough.
e2f33ee
to
9c9a89a
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
@bors r=Mark-Simulacrum |
Almost all chunks in a
ChunkedBitSet
have the same constantCHUNK_SIZE
, except the last in a bitset which takes the remainderdomain_size % CHUNK_SIZE
.r? @ghost for perf