All Projects → privatenumber → Minification Benchmarks

privatenumber / Minification Benchmarks

Licence: mit
🏃‍♂️🏃‍♀️🏃 JS minification benchmarks: babel-minify, esbuild, terser, uglify-js, swc, google closure compiler

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Minification Benchmarks

Fontmin Webpack
Minifies icon fonts to just the used glyphs.
Stars: ✭ 93 (-65.68%)
Mutual labels:  webpack, minification
Esbuild Loader
⚡️ Speed up your Webpack build with esbuild
Stars: ✭ 1,245 (+359.41%)
Mutual labels:  webpack, minification
Badge Size
🍻 Displays the size of a given file in your repository.
Stars: ✭ 277 (+2.21%)
Mutual labels:  size, gzip
Webpack Tricks
Tips and tricks in using Webpack
Stars: ✭ 2,364 (+772.32%)
Mutual labels:  webpack, minification
Speed Measure Webpack Plugin
⏱ See how fast (or not) your plugins and loaders are, so you can optimise your builds
Stars: ✭ 1,980 (+630.63%)
Mutual labels:  webpack, speed
Static Site Boilerplate
A better workflow for building modern static websites.
Stars: ✭ 1,633 (+502.58%)
Mutual labels:  webpack, minification
Gulp Size
Display the size of your project
Stars: ✭ 225 (-16.97%)
Mutual labels:  size, gzip
Webpack Bundle Analyzer
Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Stars: ✭ 11,472 (+4133.21%)
Mutual labels:  webpack, size
Reactql
Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Stars: ✭ 1,833 (+576.38%)
Mutual labels:  webpack, gzip
Static Html Webpack Boilerplate
🔮 modern tooling for old-school static webpage development
Stars: ✭ 226 (-16.61%)
Mutual labels:  webpack, minification
Vue Electron Template
An Electron & Vue.js template with Hot-reloading enabled and common Vue plugins, dev, debug and build scripts configured.
Stars: ✭ 260 (-4.06%)
Mutual labels:  webpack
Vue Express Mongo Boilerplate
⭐ MEVN Full stack JS web app boilerplate with NodeJS, Express, Mongo and VueJS
Stars: ✭ 2,814 (+938.38%)
Mutual labels:  webpack
Smidge
A lightweight runtime CSS/JavaScript file minification, combination, compression & management library for ASP.Net Core
Stars: ✭ 267 (-1.48%)
Mutual labels:  minification
Webpack Assets Manifest
This Webpack plugin will generate a JSON file that matches the original filename with the hashed version.
Stars: ✭ 269 (-0.74%)
Mutual labels:  webpack
Alfresco Ng2 Components
Alfresco Angular Components
Stars: ✭ 259 (-4.43%)
Mutual labels:  webpack
Vue.js Starter Template
A starter template for Vue.js projects
Stars: ✭ 267 (-1.48%)
Mutual labels:  webpack
Tui
This is a high quanlity components library for VUE
Stars: ✭ 258 (-4.8%)
Mutual labels:  webpack
Electron Webpack Dashboard
Electron Desktop GUI for Webpack Dashboard
Stars: ✭ 2,748 (+914.02%)
Mutual labels:  webpack
Reactgo
Your One-Stop solution for a full-stack universal Redux App!
Stars: ✭ 2,784 (+927.31%)
Mutual labels:  webpack
Webpack Lighthouse Plugin
A Webpack plugin for Lighthouse
Stars: ✭ 271 (+0%)
Mutual labels:  webpack

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

Benchmarks are gathered on the following minifiers:

If you like this project, please star it & follow me to see what other cool projects I'm working on! ❤️

👟 Methodology

  • Each minifier is executed in its own process
  • The measured time is an average taken from 10 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
  • Comments are not stripped because not all minifiers support it

📋 Results

d3 v6.3.1

  • Unminified size: 555.8 kB
  • Unminified Gzip size: 130.5 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-53% 265.4 kB 🏆-34% 87.3 kB 81x 8,026ms
terser -52% 268.0 kB -33% 87.9 kB 42x 4,155ms
esbuild -52% 270.4 kB -31% 90.6 kB 🏆 99ms
uglify-js.no-compress -51% 276.1 kB -33% 88.7 kB 13x 1,340ms
terser.no-compress -51% 276.5 kB -32% 89.2 kB 17x 1,744ms
google-closure-compiler.simple -45% 306.3 kB -22% 101.9 kB 103x 10,172ms
swc -17% 463.0 kB -10% 117.7 kB 3x 354ms
babel-minify Failed
google-closure-compiler.advanced 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.4 kB -62% 32.5 kB 199x 8,533ms
uglify-js -70% 88.9 kB 🏆-64% 31.0 kB 69x 2,980ms
terser -69% 90.3 kB -64% 31.2 kB 37x 1,608ms
esbuild -69% 90.5 kB -63% 32.2 kB 🏆 43ms
babel-minify -68% 92.4 kB -63% 31.9 kB 112x 4,806ms
uglify-js.no-compress -68% 94.3 kB -63% 31.6 kB 13x 571ms
terser.no-compress -67% 95.0 kB -63% 31.9 kB 14x 620ms
google-closure-compiler.simple -67% 96.5 kB -60% 34.5 kB 131x 5,599ms
swc -49% 147.8 kB -51% 42.4 kB 1x 81ms

lodash v4.17.20

  • Unminified size: 542.6 kB
  • Unminified Gzip size: 96.8 kB
Minifier Minified size Minzipped size Time
google-closure-compiler.advanced 🏆-89% 60.2 kB 🏆-79% 20.9 kB 175x 8,411ms
uglify-js -88% 69.5 kB -75% 24.5 kB 60x 2,889ms
terser -87% 71.2 kB -74% 25.2 kB 36x 1,761ms
babel-minify -87% 71.9 kB -74% 25.3 kB 85x 4,112ms
esbuild -87% 72.6 kB -73% 26.2 kB 🏆 48ms
uglify-js.no-compress -87% 75.2 kB -74% 25.8 kB 11x 571ms
terser.no-compress -87% 75.8 kB -73% 26.3 kB 14x 696ms
google-closure-compiler.simple -86% 77.4 kB -73% 26.3 kB 117x 5,634ms
swc -72% 155.9 kB -62% 37.6 kB 1x 71ms

moment v2.29.1

  • Unminified size: 173.9 kB
  • Unminified Gzip size: 36.5 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-67% 58.3 kB 🏆-50% 18.5 kB 65x 2,094ms
terser -66% 59.2 kB -49% 18.7 kB 38x 1,221ms
babel-minify -66% 59.2 kB -49% 18.8 kB 91x 2,907ms
esbuild -66% 60.0 kB -47% 19.4 kB 🏆 32ms
google-closure-compiler.simple -65% 60.9 kB -47% 19.7 kB 157x 5,011ms
uglify-js.no-compress -64% 63.0 kB -47% 19.5 kB 11x 380ms
terser.no-compress -64% 63.3 kB -47% 19.7 kB 15x 484ms
swc -42% 102.4 kB -30% 25.9 kB 1x 48ms
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 🏆-69% 22.8 kB 🏆-58% 8.2 kB 51x 915ms
terser -68% 23.4 kB -57% 8.4 kB 25x 460ms
babel-minify -68% 23.8 kB -57% 8.5 kB 68x 1,217ms
esbuild -67% 24.0 kB -56% 8.7 kB 1x 19ms
uglify-js.no-compress -66% 25.1 kB -56% 8.7 kB 9x 170ms
terser.no-compress -65% 25.3 kB -55% 8.9 kB 11x 208ms
google-closure-compiler.simple -55% 32.9 kB -43% 11.2 kB 235x 4,194ms
swc -42% 42.5 kB -42% 11.4 kB 🏆 18ms
google-closure-compiler.advanced Failed

terser v5.6.0

  • Unminified size: 868.1 kB
  • Unminified Gzip size: 174.2 kB
Minifier Minified size Minzipped size Time
uglify-js 🏆-54% 407.1 kB 🏆-34% 115.1 kB 71x 6,464ms
terser -53% 410.5 kB -34% 115.2 kB 40x 3,637ms
esbuild -53% 411.6 kB -33% 118.0 kB 🏆 91ms
uglify-js.no-compress -52% 422.8 kB -34% 116.0 kB 14x 1,320ms
terser.no-compress -52% 424.3 kB -34% 116.0 kB 16x 1,495ms
google-closure-compiler.simple -52% 425.2 kB -29% 125.3 kB 94x 8,590ms
swc -33% 588.6 kB -20% 140.8 kB 3x 296ms
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 🏆-49% 644.3 kB 🏆-37% 158.7 kB 67x 10,069ms
babel-minify -49% 645.3 kB -36% 161.4 kB 156x 23,345ms
esbuild -49% 647.2 kB -35% 163.3 kB 🏆 150ms
terser -48% 653.4 kB -37% 159.1 kB 35x 5,368ms
google-closure-compiler.simple -48% 660.1 kB -33% 167.1 kB 77x 11,624ms
uglify-js.no-compress -46% 675.4 kB -35% 162.9 kB 12x 1,873ms
terser.no-compress -46% 675.6 kB -35% 162.9 kB 15x 2,265ms
swc -24% 959.9 kB -21% 197.0 kB 3x 530ms
google-closure-compiler.advanced 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 2,203ms
terser -58% 95.0 kB -50% 31.3 kB 31x 1,265ms
esbuild -58% 95.2 kB -49% 31.8 kB 🏆 40ms
babel-minify -58% 95.3 kB -50% 31.5 kB 79x 3,214ms
google-closure-compiler.simple -56% 99.5 kB -47% 33.0 kB 129x 5,246ms
uglify-js.no-compress -55% 101.0 kB -49% 32.2 kB 11x 484ms
terser.no-compress -55% 101.3 kB -49% 32.2 kB 13x 548ms
swc -40% 134.7 kB -39% 38.3 kB 1x 64ms
google-closure-compiler.advanced Failed

Want to see more projects listed? PRs welcome!

🥇 Results

Best minification performance

UglifyJS takes first place for minification performance, winning 6/8 races and only losing to Google Closure Compiler by less than 9 kB! What's even more impressive is that 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 just as well as Terser while supporting cutting-edge ESNext syntax.

⚡️ 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].