The Point and Those Who Miss It
A lot has been said about Ted’s successful troll and the several responses that seem to miss the point—including mine.
To that I say: if a point is never properly made, can one truly miss it?
There are two reasons people are benchmarking Fibonacci in response to Ted’s post:
- Ted himself benchmarked it and concluded it was slow. This is wrong—it’s comparatively fast. But nobody thinks this was his entire point. It wasn’t. Let’s move on.
- Because it’s an order of magnitude faster, every single one of Ted’s clients in the
abbenchmark would receive a response before even a single client of an equivalent Python or Ruby service, regardless of their level of concurrency. Even though each request blocked the next, it still would have far better throughput than your typical Python or Ruby deployment. (This of course depends on which language runtime the deployment uses, that’s why I’m stressing “typical.”) This has everything to do with the speed of V8, and not Node’s event-based I/O.
So even the demonstration of a blocked request pipeline was rather poor. Still want to blame anyone for missing the point?
People are excited about Node because you can handle a large number of requests before even beginning to think about parallelization. If you start with a blazing fast runtime and request handler, you can put off parallelization until it matters. And it may never matter, because most web services are I/O-bound. Node also makes asynchronous programming very approachable.
Taken out of context, Node’s claim that “nothing blocks” can indeed be confusing. And I’m not defending the claim that “less-than-expert programmers are able to develop fast systems.” But Ted deliberately took “nothing blocks” out of context. Node’s site is very clear that it’s talking about blocking I/O. For CPU-intensive tasks, the Unix way is alive and well.
Running multiple Node processes to improve concurrency is not anti-Unix. It is in fact a widely-accepted approach, albeit one users are left to discover themselves with Node. Some people dismissed projects that serve this purpose, claiming that the introduction of third-party add-ons somehow invalidates the entire approach. Maybe we should stop using mod_python and mod_wsgi then, eh?
Perhaps there are some less-than-expert programmers out there shooting themselves in the foot with Node and failing spectacularly to scale. But so far they seem to be mythical.
If you want to read an article that does make a great point about Node’s concurrency—and concurrency in general—Anthony Fejes got it right.