Increase peer connection buffer size from default (4096) to 20KiB
This reduces syscall overhead which becoming noticeable.
This commit is contained in:
parent
7fccb77ebe
commit
f2bb5b1c56
|
@ -745,7 +745,7 @@ type peerExchangeMessage struct {
|
||||||
// and exit.
|
// and exit.
|
||||||
func (me *Client) connectionLoop(t *torrent, c *connection) error {
|
func (me *Client) connectionLoop(t *torrent, c *connection) error {
|
||||||
decoder := pp.Decoder{
|
decoder := pp.Decoder{
|
||||||
R: bufio.NewReader(c.Socket),
|
R: bufio.NewReaderSize(c.Socket, 20*1024),
|
||||||
MaxLength: 256 * 1024,
|
MaxLength: 256 * 1024,
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in New Issue