-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
lz4 decompression causes a lot of allocations due to ioutil.ReadAll #623
Comments
What does code look like that avoids ReadAll? io.Copy requires a destination to read into, and I don't think we can know the size of what the blob will decompress into ahead of time. |
Since we don't know the final buffer size, we can't pre-allocate. But it looks like I used such an
|
Sure, makes sense 👍 |
I found that |
Sure, also good. +1 to PR |
Let me know if you can get a PR open in the next day or two -- I have two other PRs ready that can go into a patch release and this can fit as well. |
Replaced |
While using a consumer group where messages were lz4 compressed I noticed most of the allocations were due to ioutil.ReadAll. Should we consider using
io.Copy
(fixed buffer length) instead ofioutil.ReadAll
(dynamically resized array)? I can provide benchmark results if neededThe text was updated successfully, but these errors were encountered: