]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Reduce system call overhead reading from connections
authorMatt Joiner <anacrolix@gmail.com>
Thu, 21 Sep 2017 09:29:56 +0000 (19:29 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 21 Sep 2017 09:29:56 +0000 (19:29 +1000)
connection.go

index 1d99664af7ab8b1652a5a27e804a53fbabcbf34d..774e55f1b196e2596561d1acd6a63458c39e9254 100644 (file)
@@ -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,
        }