some write contexts, put it into queue, and get it out when write data
finished, and call the callback. But for socket write, if data size is less
than system socket buffer(which can be modified by
/proc/sys/net/core/wmem_max), write() is indeed nonblock, and all async
work can be saved, than the performance of write+callback will be improve
I've forked and made a patch:
I added a benchmark(benchmark/net_rw.js), and the time consumption
decreased by about 20%.
It doesn't change the user api, but StreamWrap::WriteBuffer() returns a
Number if all data has been written.
I have run `make jslint test`, found two problems, and changed the test
1. In /test/simple/test-debugger-repl.js, one of the child processes always
does not exit, I didn't found the reason, and changed the finish cleanup
behaviours, and passed the test. But I still don't know what's the problem.
2. In /test/simple/test-tcp-wrap-listen.js, because I changed the return
value of StreamWrap::WriteBuffer(), so the test should be modified.
It's still not a perfect patch, add such a sync feature to async node is
somehow incompatible with the code logic. And I've noticed that the stream
related code is not stable yet, so if this patch is acceptable, more
imporvements can be made later.
btw: windows version has not been changed yet.
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to email@example.com
To unsubscribe from this group, send email to
For more options, visit this group at
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.