etcd-io/zetcd

efficient send message buffering

heyitsanthony opened this issue · 0 comments

The encoder expects a full-sized buffer, but the size of the message isn't known until encode time. Currently zetcd allocates a pool of maximum sized buffers and writes to those, somewhat mitigating the problem of repeatedly allocating huge buffers. However, there's still a sizeable memory cost.

Ideally the encoder will either allocate data as it needs it or copy into a larger, pooled buffer if the current buffer winds up being too small.