Increase peer connection buffer size from default (4096) to 20KiB

This reduces syscall overhead which becoming noticeable.
This commit is contained in:
Matt Joiner 2014-09-14 03:47:06 +10:00
parent 7fccb77ebe
commit f2bb5b1c56
1 changed files with 1 additions and 1 deletions

View File

@ -745,7 +745,7 @@ type peerExchangeMessage struct {
// and exit.
func (me *Client) connectionLoop(t *torrent, c *connection) error {
decoder := pp.Decoder{
R: bufio.NewReader(c.Socket),
R: bufio.NewReaderSize(c.Socket, 20*1024),
MaxLength: 256 * 1024,
}
for {