Esbuild JavaScript bundler claims 10-100x faster bundling time

Click for: original source

esbuild, a JavaScript bundler and minifier, seeks to bring order-of-magnitude speed improvements in the JavaScript bundling and minification process. esbuild achieves its speed by being written in Go compiled to native code, parallelizing tasks to leverage multi-core processors, and minimizing data transformations. By Bruno Couriol for infoq.com.

The current build tools for the web are at least an order of magnitude slower than they should be… I’m trying to create a build tool that a) works well for a given sweet spot of use cases (bundling JavaScript, TypeScript, and maybe CSS) and b) resets the expectations of the community for what it means for a JavaScript build tool to be fast.

Evan Wallace , CTO and co-founder of @figmadesign and esbuild’s creator

Wallace provided a custom-made JavaScript benchmark that shows esbuild achieving build times under one second, while other tools’ build time varies between 30s and over a minute. Similar results are observed in the provided TypeScript benchmark.

JavaScript benchmark build times

Source: https://www.infoq.com/news/2020/06/esbuild-faster-go-js-bundler/

A developer has run the benchmark on a different machine and reproduces results confirming the speed improvements.

esbuild supports constant folding and is able to handle libraries such as React that may contain conditional exports etc.:

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./cjs/react.production.min.js');
} else {
  module.exports = require('./cjs/react.development.js');
}

While the benchmark methodology needs to be refined to reflect realistic scenarios, the build times achieved by esbuild remain impressive. Super exciting!

[Read More]

Tags javascript frontend nodejs devops programming