I am surprised at the performance hit this buffering causes. Should it
really take 4.5 seconds to write 100,000 lines and 290 seconds to write
200,000 lines?

Node 0.12 will have better support for writev / corking and uncorking,
which will allow you to coalesce writes and regain some of the efficiency
lost by the individual writes ignoring fs buffering (although it doesn’t
look like fs.createWriteStream() returns a stream that coalesces by
default, so you’ll have to write your own). Which is, I suspect, the source
of the lag you’re seeing – each write to the stream has to succeed and be
acknowledged before the next one can be performed, whereas fs.write() /
fs.writeSync() are writing to the fs’s buffer. The difference is going to
be especially pronounced with an append-only file like a log.

F
​

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHG3qKrMqwNPKYLM-joR9oOuWENQvd4wqXQ1zd9QwPh5p%2BmxuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to