cortex
cortex copied to clipboard
Distributor snappy.Decode() allocated memory could be optimized with a pool
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:
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).