KalleOlaviNiemitalo commented on PR #2439: URL: https://github.com/apache/avro/pull/2439#issuecomment-1677409788
It might be possible to reduce memory allocations further, by changing the Codec API so that the caller of Codec.Decompress has to create the MemoryStream to which Codec.Decompress writes the data. This would: - Allow the same MemoryStream and its buffer to be used for multiple data blocks. - Avoid copying the data from the MemoryStream to an exact-size `byte[]` and from there to another MemoryStream. Alternatively, with a different API change, it might be possible to make BinaryDecoder read directly from the DeflateStream, avoiding the output MemoryStream altogether. However, that change might hurt performance if BinaryDecoder.Read does more work per call than MemoryStream.Read. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
