Files
bun.sh/bench/bundle/README.md
Colin McDonnell 366eba78f0 Tweaks to bundler docs (#2867)
* WIP

* Fix typo

* Updates

* Document --compile

* Add bundler benchmark

* Remove esbuild

* Add bench to docs

* Add buttons

* Updates
2023-05-16 10:47:00 -07:00

1.1 KiB

Bundler benchmark

This is a performance benchmark of the following bundlers:

  • Bun
  • esbuild
  • Parcel 2
  • Rollup + Terser
  • Webpack

It is an exact copy of esbuild's benchmark, aside from the fast that Bun has been added. The benchmark bundles 10 copies of the large three.js, with minification and source maps enabled.

To run the benchmark:

$ chmod +x run-bench.sh
$ ./run-bench.sh

Various output will be written to the console by each bundler. Scan through the results for lines that look like this underneath each bundler output:

real <number>
user <number>
sys <number>

These lines are generated by the time command which is used to benchmark each build.

Results

The real results, as run on a 16-inch M1 Macbook Pro:

Bundler Time
Bun 0.17s
esbuild 0.33s
Rollup 18.82s
Webpack 26.21
Parcel 17.95s