cijiugechu commented on PR #2840: URL: https://github.com/apache/iggy/pull/2840#issuecomment-3984613881
> > Maybe we should consider implementing more efficient Iterator methods to override the default behavior, so we don’t end up relying on std fallback implementation... > > Right, so maybe a idea would be to implement `DoubleEndedIterator` on top of the `Iterator` trait, as by the docs `DoubleEndedIterator: Iterator` I gave it a try, and implementing `DoubleEndedIterator` would require caching intermediate state, which would be a fairly substantial change. Also, making `last` O(1) doesn’t inherently depend on `DoubleEndedIterator`—it’s just how std happens to implement it. Given our current optimization goals, implementing an O(1) `last` for `Iterator` only is probably the more reasonable option. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
