Skip to content

Buffered Reads

Compare
Choose a tag to compare
@johnweldon johnweldon released this 11 Dec 04:46
· 14 commits to master since this release
e9d203d
Buffered reads (#31)

* add ReadPacket benchmark

* make readPacket use a bufio.Reader

This should give us some performance wins, since somewhere down the call
chain we read byte-by-byte, which has suboptimal performance when
reading involves a syscall.

Note that even in the recursive case, we are not buffering multiple
times, since the bufio.NewReader just returns the underlying reader if
it is already buffered.

Co-authored-by: David Bimmler <git@d4ve.email>