-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Optimize ZPipeline::mapEitherChunked
#9816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: series/2.x
Are you sure you want to change the base?
Conversation
val builder: ChunkBuilder[Out] = ChunkBuilder.make[Out](chunk.size) | ||
val iterator: Iterator[In] = chunk.iterator | ||
val builder: ChunkBuilder[Out] = ChunkBuilder.make[Out](size) | ||
val iterator = chunk.chunkIterator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1c4d37d
to
22a99e2
Compare
@@ -1820,22 +1819,23 @@ object ZPipeline extends ZPipelinePlatformSpecificConstructors { | |||
chunk => { | |||
val size = chunk.size | |||
|
|||
if (size == 0) reader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In another PR, we were talking about the fact that this Chunk can probably never be empty
22a99e2
to
45d3afa
Compare
while (iterator.hasNext && (error == null)) { | ||
val a = iterator.next() | ||
f(a) match { | ||
while (iterator.hasNextAt(index) && (error == null)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 99.99% sure that if you have size
already stored locally you can simply iterate by checking index < size
without having to call hasNextAt(index)
@guizmaii happy to merge it once you apply my recommendation above :) |
No description provided.