Thanks for this further suggestion!

I agree with the idea of making the logic simple in the loop part and reduce 
the overhead related with the `BufferBuilder` array.

I adjust the process a bit different with above codes. I think 
`bufferBuilders[targetChannel] = Optional.ofNullable(bufferBuilder)` do not 
need to be called every time during copy, because it only makes sense when it 
enters into the `while` process. Considering for common cases of small records, 
one `BuilderBuilder` can hold many serialization results, so I still retain set 
`BufferBuilder` array after requesting new buffer, and it only has a little 
overhead if one serialization record spans multiple `BufferBuilder`s. What do 
you think?

[ Full content available at: https://github.com/apache/flink/pull/6417 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to