Hacker News new | ask | show | jobs
by DTrejo 5157 days ago
The streaming node.js example he wrote uses a blocking call. This is not the node way, and would cause a definite slow-down.

If you're worried about your programs containing rogue & misbehaving code like this, I recommend you use https://github.com/isaacs/nosync

1 comments

I had the impression that "Node.js (readfile)", and possibly "Node.js" meant the blocking call but that "Node.js (streams)" meant he was using something like fs.createReadStream(). But you're right, I don't see that anywhere in the posted source.
I've tested several combinations of blocking, non blocking, readFile, streams (pipe) and using chunked transfer encoding.

Results vary a little but all way below the Vert.x results.

See blog post for the stats.

Fair enough. After I wrote that I remembered that readFile wasn't blocking anyways, but it was too late to edit at that point.