aboutsummaryrefslogtreecommitdiff
path: root/bench/bundle/README.md
blob: 64fa725f2aa02b7df837874fc6a106b01f60c7bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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](https://github.com/evanw/esbuild/blob/main/Makefile), aside from the fact that Bun [has been added](https://github.com/colinhacks/esbuild/commit/1b928b7981aa7edfadf77fcf8931bb8d6f38cd96). The benchmark bundles 10 copies of the large [three.js](https://threejs.org/), with minification and source maps enabled.

To run the benchmark:

```sh
$ 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:

```sh
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 |