Skip to content

Buffered Reads

Choose a tag to compare

@johnweldon johnweldon released this 11 Dec 04:46
· 15 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 <[email protected]>