-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement io.ReaderFrom/WriterTo for Conn #68
Conversation
d38c8e3
to
3e5f2ce
Compare
This change increase performance when proxying wrapped connections using io.Copy. Since go 1.11 copying between tcp connections uses the splice system call on linux yielding considerable performance improvments. See: https://golang.org/doc/go1.11#net Signed-off-by: Fabian Ruff <fabian.ruff@sap.com>
3e5f2ce
to
1994c14
Compare
Thank you, Fabian. Can you, please, implement example tests so to have code others can learn from while keeping up with current code coverage? |
Maybe even benchmark tests to measure the actual performance gains? |
256ec68
to
394c64c
Compare
Signed-off-by: Fabian Ruff <fabian.ruff@sap.com>
@pires I added some tests to retain code coverage.
I did those benchmarks in docker on macOS, so there is a VM involved which might introduce some noise. The results I'm getting are pretty consistent though and are in line with the originally reported gains when the splice optimisation was introduced: golang/go#10948 (comment) |
Thanks a lot!!! |
This change increases performance when proxying wrapped connections using io.Copy.
Since go 1.11 copying between tcp connections uses the splice system call on linux yielding considerable performance improvments.
See: https://golang.org/doc/go1.11#net
Signed-off-by: Fabian Ruff fabian.ruff@sap.com