philhofer/rkive — pull request #17 by philhofer (2014-08-29 15:39:09+00:00)
Title: 8% less garbage on reads; 18% less garbage on writes

There are some memory usage improvements due to changes in how `buf.Set` works.

|Garbage/op | Old | New | Delta |
|---------|:---------:|:----------:|:-------:|
| Fetch | 636B | 581B | -8% |
| Store | 754B | 614B | -18% |

Those numbers look even better if you benchmark with larger objects than the current benchmarks use.

Still the same *number* of allocs, sadly.

This PR should also prevent stack splitting on large writes. (It used to be that written messages were copied onto the stack so that we could append the 5-byte leading message frame.)