Making MemConfig stateful instead wrapping it in PhantomData could potentially have some advantages.
That saied I implemented that for Exponential, caching 'capacity' there and removed the 'capacity' field from from SegVec.
Unfortunally I see a slight performance regression, still i believe its worth integrating this. The performance regression shouldn't be a big problem in real use. Eventually it may become better optimized.
Nothing been done for Proportional, that probably needs to cache the capacity as well.
This is on top of my last PR.
Making MemConfig stateful instead wrapping it in PhantomData could potentially have some advantages.
That saied I implemented that for Exponential, caching 'capacity' there and removed the 'capacity' field from from SegVec.
Unfortunally I see a slight performance regression, still i believe its worth integrating this. The performance regression shouldn't be a big problem in real use. Eventually it may become better optimized.
Nothing been done for Proportional, that probably needs to cache the capacity as well.