Hello.
This is my first contribution to Go, so I hope I am following the proper process.
I have implemented a proof of concept for this, loosely based on the patch posted in the
aforementioned issue. A diff is available here:
As it stands now, the quality of the patch is probably not very good, which is why I hesitated
to send a CL directly. The commit message explains what I did and the decisions I made.
I tried to follow the sendfile implementation in terms of file layout and general logic.
I don't have a very strong understanding of Go internals, in particular the network poller, so I
might have done something fundamentally wrong. However, the implementation seems to
pass tests, and the benchmarks (also included in the commit message) look fairly promising.
Sadly, I do not have a fast machine with a powerful network card, or proxies with a big workload
to test the actual effectiveness of the patch on. If the implementation is indeed correct, I expect
it to reduce CPU usage and increase throughput of TCP proxies or other servers with similar patterns.
Please advise on the next course of action, if you deem this to be an avenue worth pursuing.
Thank you.
Andrei