Remove binary.{Read,Write} in favour of doing it by hand
The encoding/binary.{Read,Write} methods use reflection which is slow. This is ok for prototyping but has a serious performance impact. In each case, we know exactly what we're trying to write out, so we'll allocate our own buffer and do the explicit conversion ourselves. As an example of the performance improvement this makes, here are the results from an (internal) benchmark: benchmark old ns/op new ns/op delta BenchmarkDecode 427190 318845 -25.36%
Showing
Please register or sign in to comment