09158a6420
Motivation: Lz4FrameEncoder and Lz4FrameDecoder in their default configuration use an extremely inefficient way to checksum direct byte buffers. In particular, for every byte checksummed, a single-element byte array is being allocated and a JNI cal is made, which in some internal testing makes a 25x difference in total throughput and allocates *a lot* of garbage. Modifications: Lz4XXHash32, an implementation of ByteBufChecksum specifically for use by Lz4FrameEncoder and Lz4FrameDecoder, is introduced. It utilises xxHash32 block API which provides a hash() method that accepts a ByteBuffer as an argument. Lz4FrameEncoder and Lz4FrameDecoder are modified to use this implementation by default. Result: Lz4FrameEncoder and Lz4FrameDecoder perform well again when operating on direct byte buffers with default checksum configuration; a public implementation is provided for those who need to override the seed. |
||
---|---|---|
.. | ||
src | ||
pom.xml |