Skip to content

Distributor snappy.Decode() allocated memory could be optimized with a pool #4039

Open
@pracucci

Description

@pracucci

Is your feature request related to a problem? Please describe.
Profiling the distributors heap I can see a significant % of memory allocated by call to snappy.Decode() used by util.ParseProtoReader() to parse the remote write request:

Screenshot 2021-03-31 at 17 52 54

Describe the solution you'd like
Given snappy.Decode() picks in input the dst buffer as well, I think we may optimize it reusing the []byte via a pool (we currently pass nil as dst, so the output buffer is always newly allocated).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions