You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/02/11 18:14:08 UTC

[GitHub] merlimat opened a new pull request #1141: Replace DoubleByteBuf with ByteBufList

merlimat opened a new pull request #1141: Replace DoubleByteBuf with ByteBufList
URL: https://github.com/apache/bookkeeper/pull/1141
 
 
   This PR aims at a better approach to fix the issue reported in #1108 
   
   > Starting from Netty-4.1.13 some internal behavior has changed and that has introduced a performance penalty when using the DoubleByteBuf.
   >
   > The problem resides in the fact that netty falls back to calling nioBuffers() and that is creating an array of unpooled direct ByteBuffers. That is pretty heavy and the JVM is taking 1 to 3 seconds GC pause to reclaim them.
   
   Instead of using `CompositeByteBuf` which has the downside of needing multiple object allocations per each usage (~7-8), we should have a way to aggregate multiple buffers into a single "logical" frame with no additional overhead.
   
   This PR introduces a `ByteBufList` class which is just a holder of a list of buffers, without imitating the `ByteBuf` API. You can pass a `ByteBufList` to the channel and have the encoder take care of the multiple writes. 
   
   Instances of ByteBufList are ref-counted and released to a pool after the write is completed. There are no object allocations or memory copies involved.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services