On Tue, Apr 18, 2017 at 10:35 PM, John Snow <js...@redhat.com> wrote: > >> >> I could be wrong, but that's my hunch. >> >> Maybe you can cache the state of the INFLATE process such that once you >> fill the cache with data, we can simply resume the INFLATE procedure >> when the guest almost inevitably asks for the next subsequent bytes. >> >> That'd probably be efficient /enough/ in most cases without having to >> worry about a metadata cache for zlib blocks or a literal data cache for >> inflated data. >> >> >> Yes, I have a similar approach in mind to inflate one sector at a time >> and save the offset in the compressed stream and treat it as an access >> point for the next one. >> > > Right, just save whatever zlib library state you need to save and resume > inflating. Probably the most reasonable way to go for v1. As long as you > can avoid re-inflating prior data in a chunk when possible this is > probably good.
Yup, I have started with that. Something you should know is that I had an IRC discussion with Kevin and he suggested to fix the buffer size to a max of 2MiB as 512b (which I proposed in my previous response) is excessively low and will slow down the driver drastically! Ashijeet