Awesome Open Source
Awesome Open Source

🏃‍♂️🏃‍♀️🏃 JS minification benchmarks

Benchmarks are gathered on the following minifiers:

Support this project by ⭐️ starring and sharing it. Follow me to see what other cool projects I'm working on! ❤️

👟 Methodology

  • Each minifier is executed in its own process with a 1 minute timeout
  • The measured time is an average taken from 5 consecutive runs
  • Each table is sorted by smallest minified size in ascending order
  • Each time is annotated with a multiplier relative to the fastest minifier
  • "Minzipped size" measures how well the minified file compresses with Gzip
  • Minified artifacts can be downloaded and verified in each action run

📋 Results

antd v4.16.1

  • Unminified size: 6.7 MB
  • Unminified Gzip size: 833.5 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-67% 2.2 MB 🏆-45% 458.7 kB 46x 20,663ms
terser -66% 2.2 MB -45% 461.4 kB 21x 9,453ms
google-closure-compiler.simple -66% 2.3 MB -41% 490.3 kB 40x 18,344ms
babel-minify -66% 2.3 MB -44% 466.3 kB 112x 50,554ms
esbuild -65% 2.3 MB -41% 491.2 kB 🏆 447ms
uglify-js.no-compress -64% 2.4 MB -42% 483.0 kB 8x 3,902ms
terser.no-compress -64% 2.4 MB -42% 479.9 kB 9x 4,330ms
google-closure-compiler.advanced Failed — — —
swc Failed — — —

d3 v6.3.1

  • Unminified size: 555.8 kB
  • Unminified Gzip size: 130.5 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-52% 265.3 kB 🏆-33% 87.2 kB 87x 6,868ms
terser -52% 268.0 kB -33% 87.9 kB 41x 3,276ms
esbuild -51% 270.2 kB -31% 90.6 kB 🏆 79ms
uglify-js.no-compress -50% 276.1 kB -32% 88.6 kB 13x 1,086ms
terser.no-compress -50% 276.5 kB -32% 89.2 kB 17x 1,339ms
swc -45% 303.9 kB -26% 97.1 kB 2x 166ms
google-closure-compiler.simple -45% 306.4 kB -22% 101.9 kB 101x 7,991ms
babel-minify Failed — — —
google-closure-compiler.advanced Failed — — —

echarts v5.1.1

  • Unminified size: 3.2 MB
  • Unminified Gzip size: 689.7 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-69% 983.8 kB -53% 326.1 kB 66x 18,685ms
google-closure-compiler.simple -69% 998.0 kB -52% 329.9 kB 55x 15,654ms
terser -69% 1.0 MB 🏆-53% 322.1 kB 30x 8,511ms
babel-minify -69% 1.0 MB -53% 325.5 kB 135x 38,310ms
esbuild -68% 1.0 MB -52% 331.7 kB 🏆 283ms
uglify-js.no-compress -67% 1.1 MB -52% 331.7 kB 9x 2,671ms
terser.no-compress -66% 1.1 MB -52% 330.7 kB 13x 3,802ms
google-closure-compiler.advanced Failed — — —
swc Failed — — —

jquery v3.5.1

  • Unminified size: 287.6 kB
  • Unminified Gzip size: 84.7 kB
Minifier Minified size Minzipped size Time
google-closure-compiler.advanced 🏆-70% 87.0 kB -62% 32.4 kB 203x 6,938ms
uglify-js -69% 88.8 kB 🏆-63% 31.0 kB 72x 2,472ms
terser -69% 89.9 kB -63% 31.0 kB 38x 1,328ms
esbuild -69% 90.2 kB -62% 32.0 kB 🏆 34ms
babel-minify -68% 91.9 kB -63% 31.7 kB 107x 3,651ms
uglify-js.no-compress -67% 94.3 kB -63% 31.6 kB 14x 491ms
terser.no-compress -67% 94.6 kB -63% 31.7 kB 14x 500ms
google-closure-compiler.simple -67% 96.1 kB -59% 34.3 kB 143x 4,895ms
swc -65% 101.7 kB -57% 36.1 kB 1x 51ms

lodash v4.17.21

  • Unminified size: 544.1 kB
  • Unminified Gzip size: 97.3 kB
Minifier Minified size Minzipped size Time
google-closure-compiler.advanced 🏆-89% 60.0 kB 🏆-79% 20.8 kB 188x 7,054ms
uglify-js -87% 69.7 kB -75% 24.6 kB 65x 2,460ms
terser -87% 71.1 kB -74% 25.1 kB 37x 1,418ms
babel-minify -87% 71.8 kB -74% 25.1 kB 87x 3,273ms
esbuild -87% 72.5 kB -73% 26.1 kB 🏆 37ms
uglify-js.no-compress -86% 75.4 kB -73% 25.9 kB 13x 504ms
terser.no-compress -86% 75.7 kB -73% 26.2 kB 14x 549ms
google-closure-compiler.simple -86% 77.4 kB -73% 26.2 kB 129x 4,830ms
swc -84% 85.1 kB -70% 28.9 kB 1x 53ms

moment v2.29.1

  • Unminified size: 173.9 kB
  • Unminified Gzip size: 36.5 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-66% 58.3 kB 🏆-49% 18.5 kB 73x 1,754ms
terser -66% 59.1 kB -49% 18.6 kB 40x 966ms
babel-minify -66% 59.1 kB -49% 18.7 kB 97x 2,322ms
esbuild -66% 59.9 kB -47% 19.3 kB 🏆 24ms
google-closure-compiler.simple -65% 60.9 kB -46% 19.7 kB 172x 4,079ms
uglify-js.no-compress -64% 63.0 kB -47% 19.5 kB 13x 317ms
terser.no-compress -64% 63.2 kB -46% 19.6 kB 15x 375ms
swc -62% 66.6 kB -41% 21.5 kB 1x 29ms
google-closure-compiler.advanced Failed — — —

react v17.0.1

  • Unminified size: 72.1 kB
  • Unminified Gzip size: 19.5 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-68% 22.8 kB 🏆-58% 8.2 kB 60x 742ms
terser -68% 23.1 kB -57% 8.3 kB 29x 364ms
babel-minify -67% 23.5 kB -57% 8.4 kB 80x 987ms
esbuild -67% 23.7 kB -56% 8.6 kB 1x 14ms
uglify-js.no-compress -65% 25.1 kB -56% 8.7 kB 11x 135ms
terser.no-compress -65% 25.1 kB -55% 8.7 kB 13x 169ms
swc -63% 26.6 kB -51% 9.5 kB 🏆 12ms
google-closure-compiler.simple -55% 32.8 kB -43% 11.1 kB 285x 3,507ms
google-closure-compiler.advanced Failed — — —

terser v5.7.1

  • Unminified size: 870.0 kB
  • Unminified Gzip size: 174.6 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-53% 407.7 kB 🏆-34% 115.4 kB 66x 5,209ms
terser -53% 411.0 kB -34% 115.5 kB 37x 2,902ms
esbuild -53% 412.2 kB -32% 118.3 kB 🏆 78ms
uglify-js.no-compress -51% 423.4 kB -33% 116.4 kB 13x 1,045ms
terser.no-compress -51% 425.0 kB -33% 116.3 kB 15x 1,231ms
google-closure-compiler.simple -51% 425.6 kB -28% 125.8 kB 91x 7,116ms
swc -49% 446.0 kB -29% 123.4 kB 1x 135ms
babel-minify Failed — — —
google-closure-compiler.advanced Failed — — —

three v0.124.0

  • Unminified size: 1.2 MB
  • Unminified Gzip size: 249.0 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-48% 644.2 kB 🏆-36% 158.6 kB 62x 8,169ms
babel-minify -48% 645.3 kB -35% 161.4 kB 106x 13,990ms
esbuild -48% 647.0 kB -34% 163.2 kB 🏆 132ms
terser -48% 653.4 kB -36% 159.1 kB 31x 4,118ms
google-closure-compiler.simple -47% 660.2 kB -33% 167.1 kB 72x 9,542ms
uglify-js.no-compress -46% 675.4 kB -35% 162.9 kB 11x 1,530ms
terser.no-compress -46% 675.6 kB -35% 162.9 kB 13x 1,735ms
google-closure-compiler.advanced Failed — — —
swc Failed — — —

victory v35.8.4

  • Unminified size: 2.1 MB
  • Unminified Gzip size: 312.2 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-67% 707.2 kB -49% 159.2 kB 63x 11,352ms
terser -66% 715.6 kB 🏆-49% 158.9 kB 31x 5,730ms
esbuild -66% 724.3 kB -42% 180.5 kB 🏆 179ms
google-closure-compiler.simple -66% 727.1 kB -42% 180.8 kB 63x 11,380ms
uglify-js.no-compress -65% 756.6 kB -46% 167.6 kB 11x 2,097ms
terser.no-compress -64% 759.3 kB -47% 166.6 kB 12x 2,186ms
babel-minify Failed — — —
google-closure-compiler.advanced Failed — — —
swc Failed — — —

vue v2.6.12

  • Unminified size: 223.2 kB
  • Unminified Gzip size: 62.3 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-58% 94.2 kB 🏆-50% 31.2 kB 54x 1,811ms
terser -57% 94.9 kB -50% 31.3 kB 30x 1,020ms
esbuild -57% 95.1 kB -49% 31.8 kB 🏆 33ms
babel-minify -57% 95.2 kB -50% 31.4 kB 77x 2,542ms
google-closure-compiler.simple -55% 99.4 kB -47% 33.0 kB 132x 4,367ms
uglify-js.no-compress -55% 101.0 kB -48% 32.2 kB 12x 414ms
terser.no-compress -55% 101.2 kB -48% 32.1 kB 13x 429ms
swc -52% 107.2 kB -43% 35.4 kB 1x 43ms
google-closure-compiler.advanced Failed — — —

Want to see more projects listed? PRs welcome! See the contribution guide for more info.

🥇 Results

Best minification performance

UglifyJS takes first place for minification performance by winning 9 out of 11 races. When short, it only loses to Google Closure Compiler by less than 9 kB! Impressively, it's still written in ES5 but can handle ES6 up to ES2020.

Terser takes a very close second, only short by at most by 1~2%. Terser is a fork of uglify-es and comes with support for ES6+.

Fastest minifier

esbuild runs 10x+ laps around everyone else! The Go-lang JS minifier/bundler is a beast of its own. Not only is it insanely fast, but demonstrates very competitive minification abilities, usually performing closely to Terser while supporting cutting-edge ESNext syntax. However, note that esbuild has a limited set of optimizations and currently has no plans to improve it.

⚡️ Pro Tip: Harness the speed of esbuild in your Webpack build for minification (and even transpilation) with esbuild-loader.

Definitely keep an eye out for swc, the JS compiler written in Rust. It's also blazing fast and rumor has it they're stepping up their minification.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (70,969) 
typescript (12,070) 
webpack (1,171) 
gzip (56) 
speed (46) 
minification (28) 
benchmarks (20) 
esbuild (20) 
size (20)