compressBound often overestimates the amount of memory needed, meaning that we need to later allocate a second memory block with a smaller size than the original. However, this is very costly for large payloads. We would be able to mitigate this using a reusable memory block for compressing data.
does this first compress into the reused (probably thread-local) buffer and then gets copied to a user string? might this double the memory usage in the end?
compressBound often overestimates the amount of memory needed, meaning that we need to later allocate a second memory block with a smaller size than the original. However, this is very costly for large payloads. We would be able to mitigate this using a reusable memory block for compressing data.