Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Optimize socket read buffer sizes #1025
Nsock and Ncat currently use fixed buffer sizes for read and write operations. There ought to be ways to improve data transfer speeds by dynamically adjusting these buffer sizes. In most cases, this would mean switching from stack variables to heap-allocated buffers. In the case of Nsock, it might require a new API function to either set the size or set a restriction on how big they could grow. For Ncat, it's a producer-consumer problem; either the socket or stdout will be faster than the other, so detecting the limiting one and matching it is the goal.
No matter what, we have to start with a good measurement of transfer speed and only make changes that improve that and do not break our existing tests. I expect it will take several separate efforts (i.e. more than one PR) to get this issue solved.