cortex icon indicating copy to clipboard operation
cortex copied to clipboard

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

Open pracucci opened this issue 3 years ago • 0 comments

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).

pracucci avatar Mar 31 '21 15:03 pracucci