> On May 16, 2025, at 1:06 PM, Eric Biggers <ebiggers@xxxxxxxxxx> wrote: > > > > On Fri, May 16, 2025 at 04:43:31PM +0100, Suman Kumar Chakraborty wrote: >> Convert the implementation to a native acomp interface using zstd >> streaming APIs, eliminating the need for buffer linearization. > > How does this affect performance? Zstd does two extra things when using the streaming API: 1. Allocates a buffer of (Window_Size + 128KB). 2. Both compression and decompression have to copy data into / out of that buffer. This means there will be an extra memcpy during (de)compression. I don't know how that will compare against any efficiency gains from switching to the acomp API. It would be great to see benchmarks here. When all the data is presented in the first call to the streaming API, and Zstd can guarantee that there is enough output space, these memcpys can be elided. This happens, for example, when the data is smaller than the buffer chunk size. Best, Nick > - Eric