aboutsummaryrefslogtreecommitdiff
path: root/bench/bundle/README.md
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2023-05-16 10:47:00 -0700
committerGravatar GitHub <noreply@github.com> 2023-05-16 10:47:00 -0700
commit366eba78f0b9b2c58cdd46b906275fc8382da977 (patch)
tree8966c3964aeacc4a7f61a69164467e9ebf37b6e1 /bench/bundle/README.md
parent60bc804c58b18e99763b2d05e81bafa46800092f (diff)
downloadbun-366eba78f0b9b2c58cdd46b906275fc8382da977.tar.gz
bun-366eba78f0b9b2c58cdd46b906275fc8382da977.tar.zst
bun-366eba78f0b9b2c58cdd46b906275fc8382da977.zip
Tweaks to bundler docs (#2867)
* WIP * Fix typo * Updates * Document --compile * Add bundler benchmark * Remove esbuild * Add bench to docs * Add buttons * Updates
Diffstat (limited to 'bench/bundle/README.md')
-rw-r--r--bench/bundle/README.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/bench/bundle/README.md b/bench/bundle/README.md
new file mode 100644
index 000000000..e973fcd35
--- /dev/null
+++ b/bench/bundle/README.md
@@ -0,0 +1,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 fast 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 |