🏃♂️ 🏃♀️ 🏃 JS minification benchmarks
This repo is routinely maintained to compare the quality and speed across the latest versions of the following JavaScript minifiers:
- babel-minify
- bun
- esbuild
- google-closure-compiler
- JShrink
- minify-js
- swc
- tdewolff/minify
- terser
- uglify-js
Benchmarks last updated on Jul 23, 2023.
Found this useful? Show your support & appreciation by sponsoring!
🙋♂️ Why?
- To help you pick a minifier that fits your needs
- To promote JS minifiers and document their performances
- To encourage healthy competition and improvement amongst minifiers
👟 Methodology
- Each minifier is executed in its own process with a 20 second timeout
- Artifact integrity is verified by a test before and after minification
- Minifier upgrade PRs are automated via WhiteSource Renovate
- Benchmarks are gathered on every PR via GitHub Actions (verifiable minified artifacts are uploaded on each run)
⏱ Metrics
Minifiers are ranked by smallest minzipped size.
Minified size
Size of the minified output.
Minzipped size
Size of the minified output with Gzip compression.
For minifiers, this measures how compressable the output is.
For users, this measures network transfer size, which is usually the metric that matters most.
Time
How long minification took (average of 5 runs). Each time is annotated with a multiplier relative to the fastest minifier.
📋 Results
Artifact | Original size | Gzip size | |
---|---|---|---|
react v17.0.2 (Source) | 72.14 kB |
19.41 kB |
|
Minifier | Minified size | Minzipped size | Time |
google-closure-compiler | -68% 22.83 kB |
🏆-58% 8.17 kB |
1064x 4,074 ms |
swc | -68% 22.87 kB |
-58% 8.18 kB |
9x 36 ms |
uglify-js | 22.67 kB |
-58% 8.19 kB |
232x 890 ms |
terser | -68% 23.14 kB |
-57% 8.32 kB |
110x 422 ms |
babel-minify | -67% 23.60 kB |
-57% 8.43 kB |
368x 1,409 ms |
esbuild | -67% 23.70 kB |
-56% 8.53 kB |
6x 26 ms |
bun | -67% 23.98 kB |
-56% 8.58 kB |
6x 26 ms |
tdewolff-minify | -67% 23.53 kB |
-56% 8.62 kB |
4 ms |
uglify-js.no-compress | -65% 25.03 kB |
-55% 8.65 kB |
37x 144 ms |
terser.no-compress | -65% 25.08 kB |
-55% 8.72 kB |
48x 187 ms |
minify-js | -67% 23.46 kB |
-54% 9.00 kB |
1x 5 ms |
jshrink | -43% 40.82 kB |
-43% 11.00 kB |
42x 162 ms |
Artifact | Original size | Gzip size | |
---|---|---|---|
moment v2.29.1 (Source) | 173.90 kB |
36.15 kB |
|
Minifier | Minified size | Minzipped size | Time |
uglify-js | 🏆-67% 57.87 kB |
🏆-49% 18.46 kB |
253x 2,184 ms |
terser | -66% 59.16 kB |
-49% 18.59 kB |
131x 1,134 ms |
swc | -66% 58.38 kB |
-48% 18.67 kB |
11x 96 ms |
google-closure-compiler | -66% 58.27 kB |
-48% 18.75 kB |
564x 4,863 ms |
babel-minify | -66% 59.70 kB |
-47% 19.02 kB |
330x 2,848 ms |
esbuild | -66% 59.82 kB |
-47% 19.24 kB |
4x 42 ms |
tdewolff-minify | -66% 59.94 kB |
-46% 19.42 kB |
9 ms |
uglify-js.no-compress | -64% 62.50 kB |
-46% 19.44 kB |
44x 381 ms |
terser.no-compress | -64% 63.15 kB |
-46% 19.56 kB |
54x 469 ms |
bun | -64% 61.79 kB |
-46% 19.69 kB |
4x 36 ms |
minify-js | -65% 60.74 kB |
-42% 20.82 kB |
2x 18 ms |
jshrink | -44% 97.63 kB |
-31% 24.80 kB |
45x 396 ms |
Artifact | Original size | Gzip size | |
---|---|---|---|
jquery v3.5.1 (Source) | 287.63 kB |
84.37 kB |
|
Minifier | Minified size | Minzipped size | Time |
uglify-js | 88.54 kB |
30.85 kB |
224x 3,061 ms |
swc | -69% 89.16 kB |
-63% 30.87 kB |
12x 166 ms |
terser | -69% 89.54 kB |
-63% 30.90 kB |
117x 1,601 ms |
tdewolff-minify | -69% 89.85 kB |
-63% 31.44 kB |
14 ms |
uglify-js.no-compress | -67% 94.08 kB |
-63% 31.44 kB |
38x 521 ms |
terser.no-compress | -67% 94.55 kB |
-63% 31.59 kB |
47x 649 ms |
babel-minify | -68% 92.10 kB |
-62% 31.75 kB |
322x 4,407 ms |
esbuild | -69% 90.07 kB |
-62% 31.89 kB |
6x 84 ms |
bun | -68% 92.45 kB |
-62% 32.45 kB |
4x 58 ms |
google-closure-compiler | -68% 92.70 kB |
-61% 32.98 kB |
399x 5,459 ms |
minify-js | -69% 90.51 kB |
-61% 33.20 kB |
2x 27 ms |
jshrink | -50% 144.14 kB |
-52% 40.64 kB |
38x 523 ms |
Artifact | Original size | Gzip size | |
---|---|---|---|
vue v2.6.12 (Source) | 342.15 kB |
89.52 kB |
|
Minifier | Minified size | Minzipped size | Time |
swc | -66% 115.52 kB |
42.41 kB |
10x 237 ms |
terser | -66% 116.83 kB |
-52% 42.87 kB |
89x 1,981 ms |
uglify-js | 🏆-67% 113.98 kB |
-52% 42.89 kB |
173x 3,838 ms |
babel-minify | -66% 117.90 kB |
-51% 43.83 kB |
217x 4,831 ms |
google-closure-compiler | -66% 115.60 kB |
-51% 44.05 kB |
266x 5,915 ms |
esbuild | -65% 118.14 kB |
-51% 44.24 kB |
4x 89 ms |
uglify-js.no-compress | -63% 126.14 kB |
-50% 44.36 kB |
26x 597 ms |
tdewolff-minify | -66% 117.83 kB |
-50% 44.37 kB |
22 ms |
terser.no-compress | -63% 126.58 kB |
-50% 44.57 kB |
34x 772 ms |
bun | -64% 121.52 kB |
-50% 44.98 kB |
3x 70 ms |
minify-js | -64% 121.77 kB |
-48% 46.72 kB |
1x 36 ms |
jshrink | -42% 197.36 kB |
-36% 56.87 kB |
30x 675 ms |
Artifact | Original size | Gzip size | |
---|---|---|---|
lodash v4.17.21 (Source) | 544.10 kB |
96.40 kB |
|
Minifier | Minified size | Minzipped size | Time |
uglify-js | 68.24 kB |
24.56 kB |
167x 3,205 ms |
google-closure-compiler | -86% 73.47 kB |
-74% 24.84 kB |
294x 5,653 ms |
swc | -87% 69.86 kB |
-74% 25.06 kB |
8x 168 ms |
terser | -87% 71.05 kB |
-74% 25.07 kB |
91x 1,750 ms |
babel-minify | -87% 72.37 kB |
-74% 25.37 kB |
202x 3,874 ms |
uglify-js.no-compress | -86% 74.61 kB |
-73% 25.76 kB |
28x 552 ms |
esbuild | -87% 72.48 kB |
-73% 26.06 kB |
2x 46 ms |
terser.no-compress | -86% 75.67 kB |
-73% 26.10 kB |
36x 707 ms |
bun | -86% 74.09 kB |
-73% 26.31 kB |
2x 38 ms |
tdewolff-minify | -87% 72.47 kB |
-73% 26.32 kB |
19 ms |
jshrink | -73% 148.78 kB |
-63% 36.01 kB |
26x 509 ms |
minify-js Invalid output: SyntaxError | — | — | — |
Artifact | Original size | Gzip size | |
---|---|---|---|
d3 v6.3.1 (Source) | 555.77 kB |
129.99 kB |
|
Minifier | Minified size | Minzipped size | Time |
uglify-js | -53% 263.91 kB |
86.73 kB |
135x 7,234 ms |
swc | -52% 265.50 kB |
-33% 87.21 kB |
9x 491 ms |
terser | -52% 267.91 kB |
-33% 87.71 kB |
82x 4,415 ms |
uglify-js.no-compress | -50% 275.35 kB |
-32% 88.30 kB |
22x 1,210 ms |
terser.no-compress | -50% 276.47 kB |
-32% 88.99 kB |
37x 1,977 ms |
tdewolff-minify | -51% 269.93 kB |
-31% 89.70 kB |
53 ms |
esbuild | -51% 270.13 kB |
-30% 90.41 kB |
2x 139 ms |
bun | -51% 273.45 kB |
-30% 91.49 kB |
1x 91 ms |
google-closure-compiler | -51% 270.30 kB |
-28% 93.48 kB |
155x 8,321 ms |
minify-js | 261.82 kB |
-26% 95.58 kB |
1x 83 ms |
babel-minify Failed to minify | — | — | — |
jshrink Invalid output: TypeError | — | — | — |
Artifact | Original size | Gzip size | |
---|---|---|---|
terser v5.19.2 (Source) | 984.87 kB |
188.36 kB |
|
Minifier | Minified size | Minzipped size | Time |
uglify-js | -55% 441.14 kB |
119.98 kB |
136x 6,698 ms |
swc | -55% 445.09 kB |
-36% 120.00 kB |
8x 400 ms |
terser | -55% 447.48 kB |
-36% 120.23 kB |
83x 4,097 ms |
terser.no-compress | -53% 463.03 kB |
-36% 121.13 kB |
35x 1,752 ms |
uglify-js.no-compress | -53% 460.75 kB |
-36% 121.27 kB |
26x 1,291 ms |
tdewolff-minify | -55% 445.90 kB |
-36% 121.42 kB |
49 ms |
google-closure-compiler | 429.73 kB |
-35% 122.89 kB |
159x 7,838 ms |
esbuild | -55% 448.07 kB |
-35% 122.94 kB |
2x 100 ms |
bun | -54% 455.49 kB |
-34% 123.81 kB |
1x 61 ms |
jshrink | -37% 619.05 kB |
-25% 141.08 kB |
35x 1,770 ms |
babel-minify Failed to minify | — | — | — |
minify-js Invalid output: SyntaxError | — | — | — |
Artifact | Original size | Gzip size | |
---|---|---|---|
three v0.124.0 (Source) | 1.25 MB |
247.75 kB |
|
Minifier | Minified size | Minzipped size | Time |
swc | -48% 643.15 kB |
157.73 kB |
8x 640 ms |
uglify-js | 🏆-49% 642.22 kB |
-36% 158.26 kB |
113x 9,057 ms |
terser | -48% 654.11 kB |
-36% 158.98 kB |
71x 5,725 ms |
babel-minify | -48% 648.83 kB |
-35% 161.70 kB |
208x 16,635 ms |
google-closure-compiler | -48% 644.45 kB |
-35% 161.84 kB |
124x 9,951 ms |
uglify-js.no-compress | -46% 674.49 kB |
-35% 162.17 kB |
22x 1,796 ms |
terser.no-compress | -46% 675.60 kB |
-34% 162.35 kB |
31x 2,502 ms |
esbuild | -48% 646.76 kB |
-34% 162.65 kB |
1x 151 ms |
tdewolff-minify | -48% 644.89 kB |
-34% 163.91 kB |
1x 87 ms |
bun | -47% 662.23 kB |
-33% 164.93 kB |
80 ms |
minify-js | -47% 660.81 kB |
-32% 168.59 kB |
1x 129 ms |
jshrink | -24% 952.01 kB |
-22% 192.43 kB |
33x 2,673 ms |
Artifact | Original size | Gzip size | |
---|---|---|---|
victory v35.8.4 (Source) | 2.14 MB |
309.06 kB |
|
Minifier | Minified size | Minzipped size | Time |
uglify-js | -67% 702.67 kB |
157.52 kB |
121x 11,422 ms |
swc | -67% 708.00 kB |
-49% 157.58 kB |
9x 906 ms |
terser | -66% 715.61 kB |
-49% 158.05 kB |
85x 8,084 ms |
tdewolff-minify | -66% 718.74 kB |
-47% 164.50 kB |
94 ms |
terser.no-compress | -64% 759.34 kB |
-46% 165.72 kB |
32x 3,055 ms |
uglify-js.no-compress | -65% 756.53 kB |
-46% 166.88 kB |
23x 2,242 ms |
minify-js | 607.42 kB |
-46% 168.01 kB |
1x 185 ms |
google-closure-compiler | -67% 705.87 kB |
-44% 174.20 kB |
123x 11,581 ms |
esbuild | -66% 724.14 kB |
-42% 179.74 kB |
2x 207 ms |
bun | -66% 728.21 kB |
-41% 181.17 kB |
1x 111 ms |
babel-minify Failed to minify | — | — | — |
jshrink Invalid output: SyntaxError | — | — | — |
Artifact | Original size | Gzip size | |
---|---|---|---|
echarts v5.1.1 (Source) | 3.20 MB |
683.47 kB |
|
Minifier | Minified size | Minzipped size | Time |
swc | 🏆-69% 993.45 kB |
🏆-53% 319.77 kB |
10x 1,770 ms |
terser | -69% 1.00 MB |
-53% 321.40 kB |
76x 13,587 ms |
terser.no-compress | -66% 1.07 MB |
-52% 329.73 kB |
32x 5,801 ms |
uglify-js.no-compress | -67% 1.07 MB |
-52% 330.46 kB |
16x 3,003 ms |
esbuild | -68% 1.01 MB |
-52% 330.68 kB |
2x 400 ms |
tdewolff-minify | -68% 1.01 MB |
-52% 331.30 kB |
1x 199 ms |
bun | -68% 1.03 MB |
-51% 335.42 kB |
177 ms |
minify-js | -69% 1.01 MB |
-50% 340.93 kB |
1x 309 ms |
babel-minify Timed out | — | — | — |
google-closure-compiler Timed out | — | — | — |
jshrink Invalid output: TypeError | — | — | — |
uglify-js Timed out | — | — | — |
Artifact | Original size | Gzip size | |
---|---|---|---|
antd v4.16.1 (Source) | 6.69 MB |
825.74 kB |
|
Minifier | Minified size | Minzipped size | Time |
swc | 🏆-68% 2.15 MB |
453.62 kB |
9x 2,247 ms |
terser | -66% 2.25 MB |
-44% 458.47 kB |
62x 14,895 ms |
tdewolff-minify | -66% 2.30 MB |
-43% 473.23 kB |
239 ms |
terser.no-compress | -64% 2.43 MB |
-42% 476.68 kB |
27x 6,643 ms |
uglify-js.no-compress | -64% 2.42 MB |
-42% 479.73 kB |
18x 4,344 ms |
esbuild | -66% 2.31 MB |
-41% 488.09 kB |
2x 560 ms |
bun | -66% 2.30 MB |
-41% 490.89 kB |
1x 298 ms |
jshrink | -33% 4.45 MB |
-24% 625.76 kB |
48x 11,513 ms |
babel-minify Timed out | — | — | — |
google-closure-compiler Timed out | — | — | — |
minify-js Invalid output: TypeError | — | — | — |
uglify-js Timed out | — | — | — |
Artifact | Original size | Gzip size | |
---|---|---|---|
typescript v4.8.3 (Source) | 10.82 MB |
1.87 MB |
|
Minifier | Minified size | Minzipped size | Time |
swc | 3.27 MB |
843.46 kB |
10x 4,803 ms |
uglify-js.no-compress | -68% 3.50 MB |
-54% 866.64 kB |
20x 9,235 ms |
tdewolff-minify | -69% 3.33 MB |
-53% 867.52 kB |
452 ms |
terser.no-compress | -68% 3.49 MB |
-53% 869.36 kB |
29x 13,186 ms |
minify-js | -69% 3.31 MB |
-52% 898.44 kB |
3x 1,646 ms |
esbuild | -68% 3.45 MB |
-52% 902.92 kB |
1x 881 ms |
babel-minify Timed out | — | — | — |
bun Invalid output: AssertionError | — | — | — |
google-closure-compiler Timed out | — | — | — |
jshrink Timed out | — | — | — |
terser Timed out | — | — | — |
uglify-js Timed out | — | — | — |