Closed BenoitZugmeyer closed 1 year ago
This design was chosen to make every pushed chunk correspond to one or more chunks in the deflate stream. But as you mentioned, it's inefficient for several small chunks. It's still relatively effective for chunks of around 1MB in size (e.g. the ones returned from File.prototype.stream
, but upon reconsideration this use case is probably important to support as well.
This might be possible to resolve by preserving a 32kB lookback buffer - I'll see how difficult it is to implement.
I've successfully implemented this and will push it out in a release sometime soon.
Fixed in v0.8.0.
How to reproduce
The problem
fflate produces a much bigger output than pako. Contrary to pako, fflate does not share the deflate state for the whole stream, so previously pushed chunk aren't taken into account when pushing a new chunk.