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/03/29 05:44:47 UTC

[GitHub] merlimat opened a new pull request #1307: Use reflection based CRC32 to pass direct memory pointer

merlimat opened a new pull request #1307: Use reflection based CRC32 to pass direct memory pointer
URL: https://github.com/apache/bookkeeper/pull/1307
 
 
   The crc update with the bytebuffer is very expensive, especially in netty > 4.1.12.
   
   ```java
   crc.get().update(data.nioBuffer());
   ```
   
   Converting a direct`ByteBuf` into a `ByteBuffer` with `data.nioBuffer()` is actually resorting to allocating an unpooled `DirectByteBuffer` which is actually killing the GC (since direct memory is freed when the `DirectByteBuffer` instances are GCed, but the pauses are > 1 second).
   
   This is an adaptation of a change from Yahoo branch at https://github.com/yahoo/bookkeeper/commit/6c01ca2921a998f3bf2e85cacb27867773e7ea28
   
   Initially I though this change was not needed anymore in 4.7 codebase, and that is true for the CRC32c variant. For the regular CRC32, though, we need to avoid the bad behavior of unpooled direct buffers.

----------------------------------------------------------------
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