Skip to content

speed up net write if socket buffer large enough #715

Closed
wants to merge 1 commit into from

3 participants

@freedaxin

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:
nodejs/node-v0.x-archive#4699

And the corresponding patch for node:
freedaxin/node@d0718d0

@freedaxin freedaxin speed up net write if socket buffer large enough
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.
91d0d00
@freedaxin freedaxin referenced this pull request in nodejs/node-v0.x-archive Feb 21, 2013
Closed

speed up socket write and callback significantly #4699

@saghul
Joyent member
saghul commented Dec 10, 2013

This looks similar to what you were tying recently @indutny, maybe we can close this since it wasn't so helpful after all?

@indutny
indutny commented Dec 10, 2013

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 indutny closed this Dec 10, 2013
@freedaxin

@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"?

@indutny
indutny commented Dec 13, 2013

#1028 , but it doesn't and won't work on windows :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.