refactor(allocator): InnerVec use Alloc trait#11199
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #11199 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
d3495e1 to
8937f64
Compare
|
There's a small perf regression on a few benchmarks. I propose that we don't worry about it. Once we remove |
Merge activity
|
Parameterize `InnerVec` (otherwise known as `Vec2`) and `RawVec` with `Alloc` trait introduced in #11198. `InnerVec` and `RawVec` no longer have a dependency on `bumpalo::Bump`. The rationale for that is discussed in #11198. The only substantive change this PR makes is that all `Alloc` methods panic/abort if allocation fails, rather than returning a `Result::Err`. This alters the behavior of `try_*` methods, which previously wouldn't panic. However, I don't believe we use any of those methods, and we have no plans to, so in my view we should remove them. In practice it should be very difficult to exhaust all memory, and if we did there's no way to gracefully recover from that (what would we do? only parse half the file?). So this has little/no practical impact. That apart, this PR is pure refactor. The diff is large, but it's almost entirely adding the `A: Alloc` bound to all methods / iterators, and removing `Bump`.
69ca688 to
a2ab84b
Compare
8937f64 to
6827543
Compare

Parameterize
InnerVec(otherwise known asVec2) andRawVecwithAlloctrait introduced in #11198.InnerVecandRawVecno longer have a dependency onbumpalo::Bump. The rationale for that is discussed in #11198.The only substantive change this PR makes is that all
Allocmethods panic/abort if allocation fails, rather than returning aResult::Err. This alters the behavior oftry_*methods, which previously wouldn't panic. However, I don't believe we use any of those methods, and we have no plans to, so in my view we should remove them. In practice it should be very difficult to exhaust all memory, and if we did there's no way to gracefully recover from that (what would we do? only parse half the file?). So this has little/no practical impact.That apart, this PR is pure refactor. The diff is large, but it's almost entirely adding the
A: Allocbound to all methods / iterators, and removingBump.