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

Reuse compression buffer #6970

Open
ash2k opened this issue Feb 8, 2024 · 0 comments
Open

Reuse compression buffer #6970

ash2k opened this issue Feb 8, 2024 · 0 comments
Labels
P3 Type: Performance Performance improvements (CPU, network, memory, etc)

Comments

@ash2k
Copy link
Contributor

ash2k commented Feb 8, 2024

Use case(s) - what problem will this feature solve?

gRPC's compression code allocates a bytes.Buffer for each sent message. This code is responsible for 25% of RAM allocations in my program.

cbuf := &bytes.Buffer{}

Screenshot 2024-02-08 at 11 09 27 am

Proposed Solution

Reuse bytes.Buffer using a sync.Pool.

Alternatives Considered

Additional Context

@ash2k ash2k added the Type: Feature New features or improvements in behavior label Feb 8, 2024
@arvindbr8 arvindbr8 self-assigned this Feb 28, 2024
@ginayeh ginayeh added Type: Performance Performance improvements (CPU, network, memory, etc) P3 and removed Type: Feature New features or improvements in behavior labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Type: Performance Performance improvements (CPU, network, memory, etc)
Projects
None yet
Development

No branches or pull requests

3 participants