Hacker News new | past | comments | ask | show | jobs | submit login

Without digging into sources, since Node is single-threaded, that drastic a performance difference for an IO-bound task would have me looking at whether logging is synchronous. Node's APIs discourage synchronous IO, but don't prevent it.



Zeke mentions this in the comments[0] on the article:

>The console functions are synchronous when the destination is a terminal or a file (to avoid lost messages in case of premature exit) and asynchronous when it’s a pipe (to avoid blocking for long periods of time).

Which still seems to be the case in the LTS[1].

[0]: http://micheljansen.org/blog/entry/1698#comment-522124

[1]: https://nodejs.org/dist/latest-v4.x/docs/api/console.html#co...


So, always pipe before write?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: