Node.js is faster on Windows than on Linux – what can we learn?

In an interesting interview on DevBeat (, Rackspace systems architect and Node.js contributor Paul Querna talks about the Node.js implementation on Windows. (Original video here:

Paul’s points in the interview about making use of I/O completion ports on Windows highlights a key issue in cross-platform software development: Windows has some incredibly powerful and advanced APIs, which – if used directly – can provide huge performance benefits for software that uses them.

The common model of “develop for Linux first, then port to Windows” can mean that the ported software performs poorly on Windows installations, at least partly because you’re imposing a Linux-y execution model on a Windows system. You only need to look at the number of application handles opened by 32-bit MySQL running on Windows (at least 32k handles at startup – for *what* reason, exactly?) to see an example of a such a non-idiomatic Linux-to-Windows port.

The spoken language analogy would be using Google Translate for all your i18n needs: a big fail. Paul also points out that there is a large installed base of Windows servers out there which are not going away any time soon, so ignoring Windows when developing software is somewhat negligent.

In fact, Node in effect re-implemented I/O completion ports (, “an efficient threading model for processing multiple asynchronous I/O requests on a multiprocessor system“) inside the Node code, effectively making them available on Linux too.

Under the cover of all the Windows marketing/sales hype, there is a [largely-] POSIX-compliant, well-architected OS with some features (such as I/O completion ports) which Linux lacks. Linux obviously has features (User-mode Linux, for instance) which Windows could really use; my point here is to highlight that the “Linux first, then transliterate for Windows” is missing a trick or two.

Join the discussion...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.