Closed cehteh closed 1 year ago
Finished for now. Slice iteration is 64% faster :)
Some things are intentionally left open (I have no need for them now, can be added at some later, perhaps by someone else)
lol again 1 magic #[inline] makes it blazingly fast, actually its faster than SegVec::iter(&self) -> Iter now. Eventually this might be merged. This would be a breaking change but should simplify the codebase as only one kind of iterators has to be maintained. (can't be done now because DoubleEndedIterator is not implemented for SliceIter)
Closing in favor of #26 which includes this work, in addition to further improvements.
WIP: just to show what i am working on
The Plan is (what I need here):
(pseudocode)
Starting bottom up now, extending a 'new_segvec' by
Index
each element form a slice and push that would be terribly inefficient. So step 1 is theSegmentedIter
which walks over (parts of) the segments which can be moved over as whole. Upcoming commits will complete this.The
SegmentedIter
is public as well, might be useful in some cases andSegVec
doesn't need to hide the fact that it uses segments.I'll rebase this on master before turning 'draft' into a final PR