AsyncIterator icon indicating copy to clipboard operation
AsyncIterator copied to clipboard

Performance: Improve performance of `append` and `prepend`

Open jeswr opened this issue 3 years ago • 1 comments

See use case for append in #66 .

append and prepend still go through the SimpleTransformIterator

IMO the cleanest way to do this would be to add a parameter to the UnionIterator in #65 that requires the iterators in the union to be consumed sequentially, and then for append and prepend to just return a union of the current source, and the data to append/prepend.

@jacoscaz - do you have any thoughts on this?

jeswr avatar Apr 14 '22 01:04 jeswr

IMHO this is a (very) good idea, although I'm unsure as to how complex the final solution might be. Could be worth having a SequentialUnion iterator if having everything in one class becomes too much.

jacoscaz avatar Apr 14 '22 14:04 jacoscaz