In my testing I found that the additional appending of the output buffer to the batchmsgs_buffer adds around 450-600ns in the worst case, even if there is only one message to send (no batching). The reason is that the batchbuffer is large and almost certainly requires an additional memory fetch. I think to improve this, the encode should be done directly into the batch buffer. A little additional logic may be required. I have no problem with the batching - it's a good feature. However I would like to see the performance at least as good for a single message as without this new feature.