From: Matt Joiner Date: Thu, 21 Sep 2017 09:29:56 +0000 (+1000) Subject: Reduce system call overhead reading from connections X-Git-Tag: v1.0.0~376 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=326f60b31960b5a5f4d68761109ad109fc9a8ca3;p=btrtrc.git Reduce system call overhead reading from connections --- diff --git a/connection.go b/connection.go index 1d99664a..774e55f1 100644 --- a/connection.go +++ b/connection.go @@ -720,7 +720,7 @@ func (c *connection) mainReadLoop() error { cl := t.cl decoder := pp.Decoder{ - R: bufio.NewReader(c.r), + R: bufio.NewReaderSize(c.r, 1<<17), MaxLength: 256 * 1024, Pool: t.chunkPool, }