Use a bufio.Reader for input.

This reduces the number of system calls for reading network data,
providing a nice speedup when there are concurrent RPCs.
This commit is contained in:
Peter Mattis
2016-03-09 12:02:56 -05:00
parent b1439a2743
commit a1d076a617

View File

@ -272,7 +272,7 @@ type framer struct {
func newFramer(conn net.Conn) *framer {
f := &framer{
reader: conn,
reader: bufio.NewReaderSize(conn, http2IOBufSize),
writer: bufio.NewWriterSize(conn, http2IOBufSize),
}
f.fr = http2.NewFramer(f.writer, f.reader)