-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Bitset cleanups #147630
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?
Bitset cleanups #147630
Conversation
@bors try @rust-timer queue |
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.
448c48c
to
f6ff60b
Compare
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (c78dd25): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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. @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 -6.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 4.9%, secondary -2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 474.753s -> 474.463s (-0.06%) |
} | ||
|
||
#[inline] | ||
fn count_ones(words: &[Word]) -> usize { |
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 return a ChunkSize
directly? It's mostly used to be cast.
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.
If it returns ChunkSize
directly, then it's only correct for slices no larger than a chunk, making it incorrect for DenseBitSet::count
in the general case.
So if the return value is to be changed, it should be extracted to a separate function with a narrower name.
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.
Yeah, there are some usize
uses, so I'll leave it as is.
r=me with or without the nit |
(r=me also) |
f6ff60b
to
8386278
Compare
@bors r=cjgillot,Zalathar rollup |
…illot,Zalathar Bitset cleanups Some minor cleanups I did while working on rust-lang#147619. r? `@Zalathar`
Rollup of 7 pull requests Successful merges: - #146187 (Unstably constify `ptr::drop_in_place` and related methods) - #146503 (std: improve handling of timed condition variable waits on macOS) - #147421 (Add check if span is from macro expansion) - #147630 (Bitset cleanups) - #147666 (Replace manual implementation with `carrying_mul_add`) - #147669 (fix missing link to `std::char` in `std` docs) - #147673 (pretty print u128 with display) r? `@ghost` `@rustbot` modify labels: rollup
…illot,Zalathar Bitset cleanups Some minor cleanups I did while working on rust-lang#147619. r? `@Zalathar`
Rollup of 7 pull requests Successful merges: - #146187 (Unstably constify `ptr::drop_in_place` and related methods) - #146503 (std: improve handling of timed condition variable waits on macOS) - #147421 (Add check if span is from macro expansion) - #147630 (Bitset cleanups) - #147666 (Replace manual implementation with `carrying_mul_add`) - #147669 (fix missing link to `std::char` in `std` docs) - #147673 (pretty print u128 with display) r? `@ghost` `@rustbot` modify labels: rollup
…illot,Zalathar Bitset cleanups Some minor cleanups I did while working on rust-lang#147619. r? ``@Zalathar``
…illot,Zalathar Bitset cleanups Some minor cleanups I did while working on rust-lang#147619. r? ```@Zalathar```
Rollup of 12 pull requests Successful merges: - #146187 (Unstably constify `ptr::drop_in_place` and related methods) - #146503 (std: improve handling of timed condition variable waits on macOS) - #147526 (Move computation of allocator shim contents to cg_ssa) - #147630 (Bitset cleanups) - #147638 (bpf: return results larger than one register indirectly) - #147666 (Replace manual implementation with `carrying_mul_add`) - #147669 (fix missing link to `std::char` in `std` docs) - #147673 (pretty print u128 with display) - #147677 (Fewer exceptions in `span()` on parsed attributes) - #147680 (Fix ICE caused by associated_item_def_ids on wrong type in resolve diag) - #147682 (convert `rustc_main` to the new attribute parsing infrastructure) - #147683 (only check duplicates on old/unparsed attributes) r? `@ghost` `@rustbot` modify labels: rollup
Some minor cleanups I did while working on #147619.
r? @Zalathar