Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does reset() exist for DeflateDecoder but no GzDecoder? #313

Open
aldanor opened this issue Aug 23, 2022 · 2 comments
Open

Why does reset() exist for DeflateDecoder but no GzDecoder? #313

aldanor opened this issue Aug 23, 2022 · 2 comments

Comments

@aldanor
Copy link

aldanor commented Aug 23, 2022

It's not a huge deal, but GzDecoder::new() has a heap allocation and if you're decompressing disjoint chunks from many readers, not being able to simply reset an existing decoder is a bit depressing, especially given that it's possible for DeflateDecoder. Wonder if it would make sense to add GzDecoder::reset(reader) method?

@smabie
Copy link

smabie commented Sep 1, 2022

Also looking for this feature, am reading from a gzip compressed websocket and would really like to avoid the header heap allocation for each message since I'm working on an extremely low latency application.

@jongiddy
Copy link
Contributor

Not what you asked for, but does #323 fix this for you? It rewrites the gzip header parsing so that it does not allocate unless optional fields (extras, filename, comment, crc) are present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants