Node.js and the Web Tooling Benchmark

James M Snell
Node.js Collection
Published in
5 min readDec 14, 2017

Historically, Node.js has been viewed as a server-side tool. Its core library, tests and benchmarks have all been implemented with that fundamental assumption in mind. The reality is, however, Node.js has become one of the single most important and pervasive client-side tooling platforms available. While preserving the performance and scalability of Node.js as a server-framework is critical, it is equally important for us to recognize and embrace Node.js as a client-side tool.

The Ecosystem

Node.js exists and thrives within a symbiotic ecosystem. No single part of this ecosystem is more important or more influential than the other. A constant, productive feedback loop is essential to keeping that ecosystem healthy and vibrant.

  • TC-39 is the committee that defines the programming language.
  • VM implementers such as Google, Microsoft, and Mozilla provide the base implementation of the language, along with critical elements such as the garbage collector, compiler and optimizer.
  • Platforms such as Node.js and the various Web Browsers provide the runtime environment within which JavaScript applications are run.
  • Ecosystem developers provide the higher level tooling application developers require to be productive.

The more we can actively improve the communication, collaboration, and cooperation between these elements, the greater the benefit to the larger community of JavaScript developers.

Web Tooling Benchmark

The Web Tooling Benchmark is a collaborative effort to ensure that the VM implementations and application platforms that support the JavaScript ecosystem are capable of supporting the workloads of the most popular and most depended upon developer tooling frameworks

Developed initially by Google’s V8 performance team, the suite of benchmarks are capable of running browsers and Node.js through a series of real world scenarios using tools and libraries such as acorn, babel, esprima, typescript, and others to ensure that performance across the various platforms either improves or does not regress as the underlying language and platform implementations continue to evolve.

Thanks to some recent work by the Node.js Benchmarking Working Group, the Web Tooling Benchmark is now run nightly against Node.js master, with results posted after each run to https://benchmarking.nodejs.org

The results are compared with each of the currently active Node.js LTS streams (in this case, Node.js 6.x and 8.x).

Because the benchmarks are open source and on GitHub, it is also trivially possible to run these benchmarks yourself:

$ git clone https://github.com/v8/web-tooling-benchmark
$ cd web-tooling-benchmark
$ npm install
$ node dist/cli

The project also is happy to accept patches and feedback on the benchmarks in general at https://github.com/v8/web-tooling-benchmark.

Collaborating More to Benefit Everyone

One of the important benefits of the Web Tooling Benchmark is that it provides a fantastic opportunity for collaboration that benefits everyone. For example, Benedikt Meurer — Technical Lead for Node.js Performance on the Google V8 team — has been quite busy as of late helping make Babel faster (https://github.com/babel/babel/pulls?q=is%3Apr+is%3Aclosed+author%3Abmeurer).

Really appreciate Node reaching out to the tooling ecosystem, especially for aspects of open source such as performance which isn’t always on the top of mind when thinking about all the things we need to work on — it helps us have someone to focus (and also knowledgeable) on those issues and also bring about greater discussions on how to incorporate benchmarks and tooling into CI to prevent regressions via perf metrics, linting rules, etc.

I’ve wanted to be more involved but haven’t always had a reason or opportunities to reach out — seems like via TC39/spec and in performance there are easily aligned interests.

The impact is great (at least according to the benchmarks). There’s a difference to be said for actual perf changes because of outside factors like IO and integrations between tools (maybe we need a benchmark for that too). We even added a lot of the v8 team as collaborators (both for the spec side and the perf side). — Henry Zhu, Babel

Benedikt and his team have also been working with the Node.js core team to improve the performance of the Node.js platform itself, whether through changes to Node.js code or through improved optimization strategies within V8 that cover important core use cases. To better understand the impact and importance of this cooperation, take a moment to read through the detailed performance study published by my nearForm colleagues Matteo Collina and David Mark Clements here: https://www.nearform.com/blog/node-js-is-getting-a-new-v8-with-turbofan/.

Performance and optimizations are a critical story for webpack. Just 5–10% speed improvements can save millions of dollars in developer time and productivity. The partnerships that have been formed with NodeJS and the v8 team are invaluable and have already provided huge impact on our project and dependency of webpack like acorn [parser].

Since webpack [& babel] is a grassroots project, we are able to represent and empathize the web development community. We have been able to work with Node EPS, and Node Core team to help not only bring value back to webpack, but also share our expertise and end-user representation — Sean Larkinn, WebPack

While improving performance is certainly not the only critical success metric, it is a point at which we can all begin to collaborate in ways that will benefit everyone. Faster, more efficient, and more idiomatic code is easier for developers to maintain, is cheaper to run, and can be supported for much longer periods of time. Benchmarks, coupled with greater test coverage allows us to be less concerned about change and innovate more quickly.

Today, Node.js runs on all systems, not just servers, and increasingly powers the front-end tooling that runs the web. We are happy to be working much more closely with the Google V8 team to improve the state of JavaScript and make the web more performant. We look forward to continuing collaboration with Webpack, Babel and others to make the platform they all rely on, Node.js, the best platform for JavaScript.

--

--