https://github.com/privatenumber/minification-benchmarks Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories - + Security - * Team * Enterprise * Explore + Explore GitHub - Learn & contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Nonprofit - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} privatenumber / minification-benchmarks * Watch 6 * Star 106 * Fork 2 [?][?] JS minification benchmarks: babel-minify, esbuild, terser, uglify-js MIT License 106 stars 2 forks Star Watch * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights master 3 branches 0 tags Go to file Code Clone HTTPS GitHub CLI [https://github.com/p] Use Git or checkout with SVN using the web URL. [gh repo clone privat] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @privatenumber privatenumber chore: add swc ... cd3e5ac Jan 30, 2021 chore: add swc closes #5 cd3e5ac Git stats * 31 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows chore: lint (#4) Jan 22, 2021 lib chore: add swc Jan 30, 2021 .editorconfig refactor (#2) Dec 11, 2020 .gitignore moved content to lib directory Aug 14, 2020 .nvmrc refactor (#2) Dec 11, 2020 LICENSE refactor (#2) Dec 11, 2020 babel.config.json chore: lint (#4) Jan 22, 2021 package.json chore: add swc Jan 30, 2021 pnpm-lock.yaml chore: add swc Jan 30, 2021 readme.md chore: add swc Jan 30, 2021 View code readme.md [?][?] JS minification benchmarks Benchmarks are gathered on the following minifiers: * babel-minify * esbuild * google-closure-compiler * swc * terser * uglify-js [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 Minzipped Time size size terser ^-52% 268.0 ^-33% 87.9 ^36x kB kB 2,747ms esbuild ^-52% 270.4 ^-31% 90.6 ^ 75ms kB kB terser.no-compress ^-51% 276.5 ^-32% 89.2 ^16x kB kB 1,202ms google-closure-compiler.simple ^-45% 306.3 ^-22% 101.9 ^103x kB kB 7,786ms swc ^-18% 459.6 ^-11% 116.2 ^6x 474ms kB kB babel-minify [Failed] -- -- -- google-closure-compiler.advanced -- -- -- [Failed] uglify-js [Failed] -- -- -- uglify-js.no-compress [Failed] -- -- -- --------------------------------------------------------------------- jquery v3.5.1 * Unminified size: 287.6 kB * Unminified Gzip size: 84.7 kB Minifier Minified Minzipped Time size size google-closure-compiler.advanced ^-70% 87.4 ^-62% 32.5 ^253x kB kB 8,009ms uglify-js ^-70% 88.9 ^-64% 31.0 ^57x kB kB 1,826ms terser ^-69% 90.3 ^-64% 31.2 ^36x kB kB 1,149ms esbuild ^-69% 90.5 ^-63% 32.2 ^ 32ms kB kB babel-minify ^-68% 92.4 ^-63% 31.9 ^101x kB kB 3,199ms uglify-js.no-compress ^-68% 94.3 ^-63% 31.6 ^11x 377ms kB kB terser.no-compress ^-67% 95.0 ^-63% 31.9 ^13x 412ms kB kB google-closure-compiler.simple ^-67% 96.5 ^-60% 34.5 ^131x kB kB 4,141ms swc ^-49% 147.6 ^-51% 42.3 ^3x 101ms kB kB --------------------------------------------------------------------- lodash v4.17.20 * Unminified size: 542.6 kB * Unminified Gzip size: 96.8 kB Minifier Minified Minzipped Time size size google-closure-compiler.advanced ^-89% 60.2 ^-79% 20.9 ^223x kB kB 6,629ms uglify-js ^-88% 69.5 ^-75% 24.5 ^57x kB kB 1,704ms terser ^-87% 71.2 ^-74% 25.2 ^38x kB kB 1,152ms babel-minify ^-87% 71.9 ^-74% 25.3 ^88x kB kB 2,620ms esbuild ^-87% 72.6 ^-73% 26.2 ^ 30ms kB kB uglify-js.no-compress ^-87% 75.2 ^-74% 25.8 ^11x 344ms kB kB terser.no-compress ^-87% 75.8 ^-73% 26.3 ^15x 459ms kB kB google-closure-compiler.simple ^-86% 77.4 ^-73% 26.3 ^133x kB kB 3,950ms swc ^-72% 155.9 ^-62% 37.6 ^2x 79ms kB kB --------------------------------------------------------------------- moment v2.29.1 * Unminified size: 173.9 kB * Unminified Gzip size: 36.5 kB Minifier Minified Minzipped Time size size uglify-js ^-67% 58.3 ^-50% 18.5 ^61x kB kB 1,229ms terser ^-66% 59.2 ^-49% 18.7 ^37x 762ms kB kB babel-minify ^-66% 59.2 ^-49% 18.8 ^85x kB kB 1,732ms esbuild ^-66% 60.0 ^-47% 19.4 ^ 20ms kB kB google-closure-compiler.simple ^-65% 60.9 ^-47% 19.7 ^165x kB kB 3,340ms uglify-js.no-compress ^-64% 63.0 ^-47% 19.5 ^11x 230ms kB kB terser.no-compress ^-64% 63.3 ^-47% 19.7 ^14x 300ms kB kB swc ^-42% 102.4 ^-30% 25.9 ^2x 41ms kB kB google-closure-compiler.advanced -- -- -- [Failed] --------------------------------------------------------------------- react v17.0.1 * Unminified size: 72.1 kB * Unminified Gzip size: 19.5 kB Minifier Minified Minzipped Time size size uglify-js ^-69% 22.8 ^-58% 8.2 ^52x 652ms kB kB terser ^-68% 23.4 ^-57% 8.4 ^26x 328ms kB kB babel-minify ^-68% 23.8 ^-57% 8.5 ^60x 748ms kB kB esbuild ^-67% 24.0 ^-56% 8.7 ^ 12ms kB kB uglify-js.no-compress ^-66% 25.1 ^-56% 8.7 ^9x 116ms kB kB terser.no-compress ^-65% 25.3 ^-55% 8.9 ^11x 142ms kB kB google-closure-compiler.simple ^-55% 32.9 ^-43% 11.2 ^214x kB kB 2,647ms swc ^-42% 42.5 ^-42% 11.4 ^1x 17ms kB kB google-closure-compiler.advanced -- -- -- [Failed] --------------------------------------------------------------------- terser v5.5.1 * Unminified size: 860.3 kB * Unminified Gzip size: 173.1 kB Minifier Minified Minzipped Time size size terser ^-53% 407.2 ^-34% 114.6 ^37x kB kB 2,156ms esbuild ^-53% 408.3 ^-33% 117.3 ^ 57ms kB kB terser.no-compress ^-52% 420.8 ^-34% 115.3 ^15x 898ms kB kB google-closure-compiler.simple ^-51% 421.8 ^-28% 124.7 ^109x kB kB 6,283ms swc ^-33% 581.8 ^-20% 139.5 ^6x 377ms kB kB babel-minify [Failed] -- -- -- google-closure-compiler.advanced -- -- -- [Failed] uglify-js [Failed] -- -- -- uglify-js.no-compress [Failed] -- -- -- --------------------------------------------------------------------- three v0.124.0 * Unminified size: 1.2 MB * Unminified Gzip size: 249.0 kB Minifier Minified Minzipped Time size size uglify-js ^-49% ^-37% ^67x 644.5 kB 159.1 kB 5,783ms babel-minify ^-49% 645.3 ^-36% 161.4 ^121x kB kB 10,497ms esbuild ^-49% 647.2 ^-35% 163.3 ^ 86ms kB kB terser ^-48% 653.4 ^-37% 159.1 ^35x kB kB 3,088ms google-closure-compiler.simple ^-48% 660.1 ^-33% 167.1 ^89x kB kB 7,712ms uglify-js.no-compress ^-46% 675.4 ^-35% 162.9 ^12x kB kB 1,081ms terser.no-compress ^-46% 675.6 ^-35% 162.9 ^15x kB kB 1,338ms swc ^-24% 958.8 ^-22% 196.2 ^6x 528ms kB kB google-closure-compiler.advanced -- -- -- [Failed] --------------------------------------------------------------------- vue v2.6.12 * Unminified size: 223.2 kB * Unminified Gzip size: 62.3 kB Minifier Minified Minzipped Time size size uglify-js ^-58% 94.2 ^-50% 31.2 ^46x kB kB 1,277ms terser ^-58% 95.0 ^-50% 31.3 ^25x 707ms kB kB esbuild ^-58% 95.2 ^-49% 31.8 ^ 28ms kB kB babel-minify ^-58% 95.3 ^-50% 31.5 ^68x kB kB 1,912ms google-closure-compiler.simple ^-56% 99.5 ^-47% 33.0 ^123x kB kB 3,435ms uglify-js.no-compress ^-55% 101.0 ^-49% 32.2 ^10x 279ms kB kB terser.no-compress ^-55% 101.3 ^-49% 32.2 ^11x 324ms kB kB swc ^-40% 134.6 ^-39% 38.2 ^1x 50ms kB kB google-closure-compiler.advanced -- -- -- [Failed] --------------------------------------------------------------------- Want to see more projects listed? PRs welcome! Results Best minification performance UglifyJS takes first place for minification performance. This is quite impressive as it doesn't support or leverage new and concise ES6+ syntax (hence the failed minifications for "terser v5.5.1"). Terser takes a very close second, only short at most by 1%. Terser is a fork of uglify-es and comes with support for ES6+. Fastest minifier esbuild runs 10x+ laps around everyone else! Nothing comes close to the Go compiled minifier/bundler. esbuild's minification supports cutting-edge ESNext syntax and performs very competitively--only short at most by 2% from UglifyJs. [?][?] Pro Tip: Harness the speed of esbuild in your Webpack build for minification (and even transpilation) with esbuild-loader. About [?][?] JS minification benchmarks: babel-minify, esbuild, terser, uglify-js Topics javascript speed benchmarks size minification uglify-js babel-minify gzip-size minifiers esbuild tesrser minification-benchmarks Resources Readme License MIT License Languages * JavaScript 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.