From 326f60b31960b5a5f4d68761109ad109fc9a8ca3 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 21 Sep 2017 19:29:56 +1000 Subject: [PATCH] Reduce system call overhead reading from connections --- connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, }