I call Brotli.CompressBuffer(memory, 0, memory.Length) on .NET 9.0 to compress an array of bytes and it's very slow : each call will take 100ms in average (compared to 1-2ms for DeflateStream).
The memory buffer I try to compress is 640 KB (this is not that big).
I need to compress each buffer individually (so I can't create an instance of BrotliEncoder and call Compress() each iteration).
EDIT : it's probably due to default encoder settings which might be quite high.
I call
Brotli.CompressBuffer(memory, 0, memory.Length)on .NET 9.0 to compress an array of bytes and it's very slow : each call will take 100ms in average (compared to 1-2ms forDeflateStream).The memory buffer I try to compress is 640 KB (this is not that big).
I need to compress each buffer individually (so I can't create an instance of
BrotliEncoderand callCompress()each iteration).EDIT : it's probably due to default encoder settings which might be quite high.