Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to choose the best JS engine for your Node performance

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to choose the best JS engine for your Node performance. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.

tl;dr

Node.js is growing rapidly. Node.js 8 has been released. Meanwhile, a version of Node.js based on ChakraCore is also under active development.

The original author used the word Node.js v8 version, for which the author specifically explained in parentheses that V8 here is not the javascript engine V8, but the version of Node.js. But there is a comment in the Node.js official blog post Node v8.0.0 (Current):

Note that, when referring to Node.js release versions, we have dropped the "v" in Node.js 8. Previous versions were commonly referred to as v0.10, v0.12, v4, v6, etc. In order to avoid confusion with V8, the underlying JavaScript engine, we've dropped the "v" and call it Node.js 8.

Note that we have removed the "v" in Node.js 8 when referencing Node.js releases. Previous versions are often referred to as v0.10, v0.12, v4, v6, etc. To avoid confusion with the V8 JavaScript engine, we dropped the "v" and called it Node.js 8.

Therefore, Node.js v8 should be called Node.js 8.

Since Node.js uses JavaScript engines that don't know when new features will be introduced, developers have a clear idea of how different engines perform.

We evaluated the performance of the following Node.js versions:

Node.js 6.10.1 (V8 5.1.281.95)* Node.js 7.10 (V8 5.5.372.43)

Node.js 7.10 uses the--turbo --ignition parameter (V8 5.5.372.43)

Node.js 8.0 (V8 5.8.283.41)

Node.js 8.0 uses the--turbo --ignition parameter (V8 5.8.283.41)

Node.js 8.0 (ChaKraCore 2.0.0.0) (using 2 different builds)

This simple [visualization tool][6] allows you to see how different versions affect the performance of different features.

In these results, if you are using Node.js 8, you can also see javascript performance with the--turbo--ignition parameter turned on.

Context

While V8 is the default JavaScript engine used by Node.js, Node.js provides a common platform that allows developers to choose between different JavaScript engines.

The release of Node.js 8 is very exciting and a big event within the community. The platform comes with a whole new set of features. In addition, developers are most concerned about performance.

Understanding which JavaScript engine is best suited to running your application can be a very useful skill. In this article, we'll see how different versions of V8 and ChakraCore compare in terms of performance.

way

To compare benchmarks between different Node.js versions, I chose 35 representative JavaScript code patterns. Most of them were taken from Colin Ihrig's 'will it optimize' repo. These patterns have been discussed in the previous article Optimize your Node app by simply upgrading Node.js.

For each pattern, each version of Node.js was run 10, 100, 1000, 10000, and 10000 times, respectively. By allowing this code, we can understand how each engine performs runtime general optimizations and hot function optimizations.

The benchmark does not consider the number of garbage collection (GC) events. This means that if you modify the memory allocated to each process, the results of the experiment may be different.

results

The full test results can be viewed on this page. By analyzing this result, we can see that the Node.js version of ChakraCore is slower than the V8-based version.

Also, in most cases, V8 becomes more efficient over time. Ignition and Turbofan optimization architectures significantly improve performance. Node.js 8 was released with V8 5.8, but is not enabled by default. Future versions of Node.js will ship with V8 5.9 (and possibly 5.6) with Ignition and Turbofan enabled.

About "How to choose the best JS engine for your Node performance" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report