-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use HybridBitSet
in SparseBitMatrix
.
#54318
Use HybridBitSet
in SparseBitMatrix
.
#54318
Conversation
`SparseBitSet` is the only remaining user of `ArrayVec`. This commit switches it to using `SmallVec`, and removes `array_vec.rs`. Why the switch? Although `SparseBitSet` is size-limited and doesn't need the ability to spill to the heap, `SmallVec` has many more features than `ArrayVec`. In particular, it's now possible to keep `SparseBitSet`'s elements in sorted order, which gives in-order iteration, which is a requirement for the next commit.
|
This comment has been minimized.
This comment has been minimized.
This requires adding a few extra methods to `HybridBitSet`. (These are tested in a new unit test.) This commit reduces the `max-rss` for `nll-check` builds of `html5ever` by 46%, `ucd` by 45%, `clap-rs` by 23%, `inflate` by 14%. And the results for the `unic-ucd-name` crate are even more impressive: a 21% reduction in instructions, a 60% reduction in wall-time, a 96% reduction in `max-rss`, and a 97% reduction in faults! Fixes rust-lang#52028.
b457ed0
to
154be2c
Compare
The submodules changes were accidental, and I have reverted them. |
The second commit is probably the cause of this, because it removes |
@bors try |
⌛ Trying commit 154be2c with merge c243f30671409bce0ef56f65b318efac3c0012ff... |
☀️ Test successful - status-travis |
@rust-timer build c243f30671409bce0ef56f65b318efac3c0012ff |
Success: Queued c243f30671409bce0ef56f65b318efac3c0012ff with parent b80cb47, comparison URL. |
Looks great to me. The dummy bitsets are unfortunate, but I'd rather land this first and then after that, maybe I will investigate revising the coding patterns to get rid of them. |
@bors r+ |
📌 Commit 154be2c has been approved by |
ah, I guess it would be prudent to wait until the results are back from rust-timer. @bors r- |
I expect the rust-timer results will be much the same as what I got locally, but sure, we can wait. |
perf results are ready, awesome improvements for max-rss as expected 🎉 |
@bors r+ |
📌 Commit 154be2c has been approved by |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
⌛ Testing commit 154be2c with merge 64c407e0bd7c91a9feb4666a90075a1c650460ed... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors retry |
…x, r=pnkfelix Use `HybridBitSet` in `SparseBitMatrix`. This fixes most of the remaining NLL memory regression. r? @pnkfelix, because you reviewed #54286. cc @nikomatsakis, because NLL cc @Mark-Simulacrum, because this removes `array_vec.rs` cc @lqd, because this massively improves `unic-ucd-name`, and probably other public crates
I'd love to know how to avoid them. I asked about this for a similar example in /r/rust and the answers all involved repeated matches and |
💔 Test failed - status-appveyor |
AFAICT, the @bors retry, I guess |
@bors retry |
…x, r=pnkfelix Use `HybridBitSet` in `SparseBitMatrix`. This fixes most of the remaining NLL memory regression. r? @pnkfelix, because you reviewed #54286. cc @nikomatsakis, because NLL cc @Mark-Simulacrum, because this removes `array_vec.rs` cc @lqd, because this massively improves `unic-ucd-name`, and probably other public crates
☀️ Test successful - status-appveyor, status-travis |
This fixes most of the remaining NLL memory regression.
r? @pnkfelix, because you reviewed #54286.
cc @nikomatsakis, because NLL
cc @Mark-Simulacrum, because this removes
array_vec.rs
cc @lqd, because this massively improves
unic-ucd-name
, and probably other public crates