jsshell (SpiderMonkey). Even though the benchmark is not limited to Node.js, we are excited that the Node.js benchmarking working group is considering using the tooling benchmark as a standard for Node performance as well (nodejs/benchmarking#138).
- The Babel transpiler using the
- The parser used by Babel — named Babylon — running on several popular inputs (including the lodash and Preact bundles).
- The acorn parser used by webpack.
- The TypeScript compiler running on the typescript-angular example project from the TodoMVC project.
See the in-depth analysis for details on all the included tests.
We created a tracking bug and a spreadsheet to contain all the relevant information that we have collected about V8’s performance on the new benchmark up to this point. Our investigations have already yielded some interesting results. For example, we discovered that V8 was often hitting the slow path for
instanceof (v8:6971), incurring a 3–4× slowdown. We also found and fixed performance bottlenecks in certain cases of property assignments of the form of
obj[name] = val where
obj was created via
Object.create(null). In these cases, V8 would fall off the fast-path despite being able to utilize the fact that
obj has a
null prototype (v8:6985). These and other discoveries made with the help of this benchmark improve V8, not only in Node.js, but also in Chrome.
We not only looked into making V8 faster, but also fixed and upstreamed performance bugs in the benchmark’s tools and libraries whenever we found them. For example, we discovered a number of performance bugs in Babel where code patterns like
value = items[items.length - 1];
lead to accesses of the property
"-1", because the code didn’t check whether
items is empty beforehand. This code pattern causes V8 to go through a slow-path due to the
Our strong focus on real-world performance and especially on improving popular Node.js workloads is shown by the constant improvements in V8’s score on the benchmark over the last couple of releases:
Since V8 v5.8, which is the last V8 release before switching to the Ignition+TurboFan architecture, V8’s score on the tooling benchmark has improved by around 60%.
The best news of all is that given how the Web Tooling Benchmark is constructed around real workloads, we expect that our recent improvements in benchmark scores will translate directly into improved developer productivity through less time waiting for things to build. Many of these improvements are already available in Node.js: at the time of writing, Node 8 LTS is at V8 v6.1 and Node 9 is at V8 v6.2.
The latest version of the benchmark is hosted at https://v8.github.io/web-tooling-benchmark/.