2 ms·
That was the citation :-) Seriously though, Node is written in C++ and is a single threaded interpreted / Jitted / Garbage Collected Virtual Machine which has
by socmag 10y ago
That was the citation :-)
Seriously though, Node is written in C++ and is a single threaded interpreted / Jitted / Garbage Collected Virtual Machine which has to jump through trampolines and layers of abstraction to call system services.
While it might be very efficient at what it does, it isn't as close to the machine as a native C++ application.
One asynchronous WebSocket server written in C++ can run rings around one Node WebSocket server.
If the premise is that to mitigate this we can set up an entire cluster of node servers that will beat the C++ server, it follows that we can set up an entire cluster of C++ servers that would be even faster.
C++ is faster in every regard. There is no "usually", about it.
If we are talking about some metric like programmer productivity, sure sometimes it takes more effort to write code in C++ to achieve what may take a single line in Node.
- tehlike 10y agoOk let me rephrase: The speed benefit of C++ not always matters. At Google scale, sure. For most intents and purposes, probably not. Otherwise, totally agreed.
- socmag 10y agoI use node quite a lot, mostly for prototyping, demos and where I just plain don't have the time or need to use something else. I have no problem with node as an application development platform. Right tool for the right job is fine The trick is to minimize aggregate kWh of energy use per unit task. Sometimes that means ordering a take out, and occasionally baking a pie. A lot of the time I'm in the position of buildng upstream tools and platforms for people downstream, so whatever I do has a direct impact on their performance. The way I look at it is it is my duty to make them look good. I do take that a little far though on occasion. Shipping is a feature too of course. Heh.