Skip to content

Reuse compression buffer #6970

Closed as not planned
Closed as not planned
@ash2k

Description

@ash2k

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: RPC FeaturesIncludes Compression, Encoding, Attributes/Metadata, Interceptors.P3Type: PerformancePerformance improvements (CPU, network, memory, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions