shadowsocks / go-shadowsocks2

Modern Shadowsocks in Go
Apache License 2.0
4.45k stars 1.39k forks source link

one trick to improve performance perhaps #178

Closed leewi9 closed 4 years ago

leewi9 commented 4 years ago

use io.CopyBuffer instead of io.Copy in the tcp.go

set the buffer size larger or find the optimal buffer size

riobard commented 4 years ago

You should not make random suggestions like this without understanding the code base or running real benchmarks. It's a waste of both your and my time.

leewi9 commented 4 years ago

I said perhaps

Who do you think you are?

riobard commented 4 years ago

Excuse me? I wrote the majority of the code base.

Your suggestion demonstrates your lack of understanding about how io.Copy works underneath, and apparently you did not study this code base to learn how it optimizes memory allocation.