net: Avoid tickDepth warnings on small writes
authorisaacs <i@izs.me>
Mon, 28 Jan 2013 19:15:53 +0000 (11:15 -0800)
committerisaacs <i@izs.me>
Tue, 29 Jan 2013 00:16:21 +0000 (16:16 -0800)
commit02f7d1bfd8b5b75620352774967dce63b0934037
tree6d6180a9cd74bf33e81101807d43a986a40384f4
parent6311f1c30a9c579dc354d84809099d28f074b3de
net: Avoid tickDepth warnings on small writes

Always defer the _write callback.  The optimization here was only
relevant in some oddball edge cases that we don't actually care about.

Our benchmarks confirm that just always deferring the Socket._write cb
is perfectly fine to do, and in some cases, even slightly more
performant.
lib/net.js
test/simple/test-net-many-small-writes.js [new file with mode: 0644]