mccolljr / segvec

SegVec data structure for rust. Similar to Vec, but allocates memory in chunks of increasing size.
MIT License
33 stars 4 forks source link

Remove phantomdata/Stateful MemConfig #22

Closed cehteh closed 1 year ago

cehteh commented 1 year ago

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.

mccolljr commented 1 year ago

Can you rebase on master and then push, to clean up the conflicts? Once you do that I can merge.

cehteh commented 1 year ago

Can you rebase on master and then push, to clean up the conflicts? Once you do that I can merge.

Will do soon.