add uv_try_write() to libuv, try to write as many bytes as possible
into socket buffer for nonblocking socket, if all data is written
successfully, async uv write can be avoid, thereby saving the
consumption of uv context and queue operations.
I've opened an issue in node, where explained the reason in detail:
And the corresponding patch for node:
speed up net write if socket buffer large enough
This looks similar to what you were tying recently @indutny, maybe we can close this since it wasn't so helpful after all?
Well, it won't work at windows, so I decided that it isn't worth having it. Anyway, @freedaxin I wonder how much improvement did it gave to you?
@indutny, I got a improvement about 30% in my project. Maybe the patch is not perfect, but the approach is right. I wonder what's your "tying recently"?
#1028 , but it doesn't and won't work on windows :)