We performed a benchmark over a few versions of Node.js:
* Node.js 6.10.1 (V8 5.1.281.95)
* Node.js 7.10 (V8 5.5.372.43)
* Node.js 7.10 with the
--turbo --ignition flags (V8 5.5.372.43)
* Node.js 8.0 (V8 5.8.283.41)
* Node.js 8.0 with the
--turbo --ignition flags (V8 5.8.283.41)
* Node.js 8.0 (ChaKraCore 18.104.22.168) (Two different builds were used)
The results of this benchmark are available through a small visualization tool.
According to these results, if you are using Node.js 8, you really might want to try to run your applications with the
--turbo --ignition flags to see a performance boost.
The release of Node.js 8 is extremely exciting and has been a huge event within the community. A brand new set of features have been shipped with the platform. Also, performances consideration are being closely looked at by the developers.
For each pattern, it has been run 10, 100, 1000, 10000 and 10000 times with each version of Node.js in the scope. This has been done in order to see how each engine could optimize a stable and hot function at runtime.
The benchmark did not take into account the number of garbage collection events. This means that if the allocated memory given to each process were to be modified, the whole result of the experiment might be different.
The complete results are available on this page. As a general outcome, we can safely consider that the ChakraCore based version of Node.js is slower than the V8 based ones.
Also, in most cases, V8 becomes more and more efficient in time. The Ignition + Turbofan optimization architecture will definitely provide a performance boost. Node.js 8 is shipped with V8 5.8 which does not enable this by default. Future versions of Node.js will be shipped with V8 5.9 (and possibly 5.6) with Ignition + Turbofan enabled.
This benchmark was incredibly fun to run, and I will plan to keep it updated in the future with newer versions of Node.js and more code patterns. As Sqreen’s Node.js engineer, I am extremely concerned about performance. The agent we have built has the least performance impact possible for our clients’ applications. Knowing what code patterns are the fastest is a critical part of my job.
If you are concerned by the security of your Node.js applications, you can take a look at Sqreen which revolutionizes the way engineering teams protect apps from intrusions & data loss.
The Turbofan + Ignition architecture seems to speed up Node.js 8 applications a lot. I recommend you try it with your own benchmarks. Let me know how that goes!
Even if it shows that Node.js is more powerful with V8, this might change in the future as the ChakraCore team updates its engine and as new versions of Node.js appear (I’m looking at you SpiderNode).
In the end, the Node.js ecosystem will become more and more diverse.
I hope you enjoyed this article. Do not hesitate to share it around and to read my other articles on Sqreen’s blog. I also would love to have your feedback and comments here.