airlift / aircompressor

A port of Snappy, LZO, LZ4, and Zstandard to Java
Apache License 2.0
549 stars 110 forks source link

Improve ZSTD decomompress byte buffer performance #156

Closed bholdt closed 1 year ago

bholdt commented 1 year ago

I have run a bunch of performance benchmarks. The ZSTD.decompress method with byte arrays was a lot faster than the ZSTD decompress with ByteBuffers.

It's because the ByteBuffer implementation allocates another ZSTD Frame Decompressor every time it decompresses.

This PR uses the already existing ZSTDFrameDecompressor instead of allocating a new one for every decompression.

sonatype-lift[bot] commented 1 year ago

:warning: 7 God Classes were detected by Lift in this project. Visit the Lift web console for more details.