Why is node.js so much faster?
1st January 2013
My answer to Why is node.js so much faster? on Quora
There are two main reasons.
Firstly, Node runs on top of Google’s V8 JIT-compiled JavaScript engine, originally written for Chrome, which is extremely fast for an implementation of a dynamic language (faster than any of the various Ruby implementations).
Secondly, Node emphasises callback-based asynchronous IO and makes it very hard to make blocking calls. For web apps that spend most of their time waiting on network or database connections this can be a lot more efficient: http://code.danyork.com/2011/01/...
Ruby can do asynchronous IO using EventMachine or similar but you have to specifically work for it—with Node you get that behaviour by default.
More recent articles
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024