luben / zstd-jni

JNI binding for Zstd
Other
808 stars 165 forks source link

Support ZstdCompressCtx/ZstdDecompressCtx in ZstdInputStream/ZstdOutputStream #272

Open DeepController opened 11 months ago

DeepController commented 11 months ago

Hi!

According to the manual

It is recommended to re-use ZSTD_CStream since it will play nicer with system's memory, by re-using already allocated memory. note : since v1.3.0, ZSTD_CStream and ZSTD_CCtx are the same thing.

However, it does not mention the same for DStream.

Could we explore the option to let library user to manage the cycle of Compression/Decompression context so that it could be reused in multiple stream? It would be more performant and memory-friendlier.

Thanks!!