• Stars
    star
    830
  • Rank 54,934 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

This repo is routinely maintained to compare the quality and speed across the latest versions of the following JavaScript minifiers:

Benchmarks last updated on Jul 23, 2023.

Found this useful? Show your support & appreciation by sponsoring! ❤️

🙋‍♂️ Why?

  1. To help you pick a minifier that fits your needs
  2. To promote JS minifiers and document their performances
  3. 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 🏆-69% 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 🏆-69% 88.54 kB 🏆-63% 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 🏆-53% 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 🏆-87% 68.24 kB 🏆-75% 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 🏆-33% 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 🏆-53% 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 🏆-36% 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 🏆-56% 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 🏆-36% 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 🏆-49% 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 🏆-72% 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 🏆-45% 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 🏆-70% 3.27 MB 🏆-55% 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

Sponsors

More Repositories

1

tasuku

✅ タスク — The minimal task runner for Node.js
TypeScript
1,687
star
2

cleye

👁‍🗨 cleye — The intuitive & typed CLI development tool for Node.js
TypeScript
361
star
3

snap-tweet

Snap a screenshot of a tweet 📸
TypeScript
312
star
4

vue-2-3

↔️ Interop Vue 2 components in Vue 3 apps and vice versa
JavaScript
277
star
5

pkgroll

📦 🍣 Next-gen package bundler for TypeScript & ESM
TypeScript
249
star
6

ts-runtime-comparison

Comparison of Node.js TypeScript runtimes
TypeScript
219
star
7

vue-frag

🤲 Create Fragments (multiple root-elements) in Vue 2
TypeScript
194
star
8

link

🔗 A better `npm link`
TypeScript
117
star
9

type-flag

⛳️ Typed command-line arguments parser for Node.js
TypeScript
114
star
10

get-tsconfig

tsconfig.json paser & paths matcher
TypeScript
91
star
11

github-cdn

🛰 Github CDN Server
JavaScript
47
star
12

ci

Run npm ci using the appropriate Node package manager (npm, yarn, pnpm)
TypeScript
45
star
13

dbgr

Lightweight debugger for Node.js
TypeScript
44
star
14

clean-pkg-json

Script to remove unnecessary properties from package.json on prepublish hook
TypeScript
41
star
15

vue-frag-plugin

Webpack/Rollup/Vite plugin to add multiple root-node support to Vue 2 SFCs
TypeScript
41
star
16

instant-mocha

☕️ Build tests with Webpack and run with Mocha in one command
TypeScript
41
star
17

resolve-pkg-maps

Resolve package.json `exports` & `imports` maps
TypeScript
39
star
18

git-publish

☁️ Publish your npm package to a GitHub repository branch
TypeScript
38
star
19

compare-bun-node

Comparison of Bun's API against Node.js's
JavaScript
38
star
20

VisualQuery

Light & minimal front-end query builder for jQuery
JavaScript
38
star
21

webpack-localize-assets-plugin

🌐 Localize your Webpack bundle with multiple locales
TypeScript
38
star
22

webpack-json-access-optimizer

Webpack plugin to tree-shake and minify JSON modules
TypeScript
37
star
23

terminal-columns

Render readable & responsive tables in the terminal
TypeScript
32
star
24

deps

📦🔍 Analyze which package.json dependencies are in-use with V8 Coverage 🔥
TypeScript
31
star
25

vue-pseudo-window

🖼 Declaratively interface window/document/body in your Vue template
JavaScript
31
star
26

manten

💮 満点 - Lightweight testing library for Node.js
TypeScript
29
star
27

svg-browser-export

Export SVG to PNG, JPEG, or WEBP in the browser
TypeScript
23
star
28

comment-mark

Interpolate strings with HTML comment markers!
TypeScript
23
star
29

npm-multi-publish

Publish an npm package to multiple registries
JavaScript
23
star
30

reactive-json-file

💎 Reactively sync JSON mutations to disk
TypeScript
23
star
31

playwright-start

Start a long-running Playwright browser server via CLI
TypeScript
22
star
32

ink-task-list

Task runner components for Ink
TypeScript
22
star
33

chainset

Set object values using property chaining syntax
TypeScript
21
star
34

build-this-branch

🤖 Script to automate creating built branches
TypeScript
21
star
35

vue-vnode-syringe

🧬 Add attributes and event-listeners to <slot> content 💉
JavaScript
20
star
36

vue-dom-hints

Vue.js devtool for identifying Vue components and their SFC paths in the DOM
JavaScript
20
star
37

vue-grep

Grep your Vue.js codebase with CSS selectors
TypeScript
19
star
38

git-squash-branch

Script to squash the commits in the current Git branch
TypeScript
17
star
39

fs-fixture

Easily create test fixtures at a temporary file-system path
TypeScript
16
star
40

vue-split-view

Create a resizable split-view to partition the UI
Vue
16
star
41

alias-imports

Create Node.js aliases via imports map
TypeScript
16
star
42

vue-import-loader

🌐 Webpack loader to automatically detect & import used components
JavaScript
13
star
43

fs-require

Create a require() function from any file-system. Great for in-memory fs testing!
TypeScript
13
star
44

pkg-entry-points

Get all entry-points for an npm package. Supports the `exports` field in `package.json`
TypeScript
13
star
45

vue-subslot

💍 Pick out specific elements from the component <slot>
JavaScript
12
star
46

gh-emojis

Use GitHub emojis from their API as an npm package
JavaScript
12
star
47

litemark

🖋 GitHub Flavored Markdown Editor
Vue
12
star
48

hirok.io

👤 My personal website & blog
Vue
11
star
49

vue-proxi

💠 Tiny proxy component for Vue.js
JavaScript
11
star
50

bfs

Find the path of a value in a complex JavaScript object graph/tree.
JavaScript
11
star
51

prerelease-checks

Run essential pre-release checks before releasing an npm package
TypeScript
11
star
52

git-detect-case-change

🤖 Script to detect file name case changes in a Git repository
TypeScript
10
star
53

cli-simple-table

Simple CLI table for simple people
TypeScript
9
star
54

webpack-test-utils

Utility functions to test Webpack loaders/plugins
TypeScript
8
star
55

vue-svg-icon-set

Efficiently expose a SVG icon set in Vue
JavaScript
8
star
56

webpack-playground

Demonstration of different Webpack configurations
JavaScript
8
star
57

eslint-config

TypeScript
7
star
58

vue-v

Tiny component to render Vue.js vNodes in the template.
JavaScript
7
star
59

i-peers

npx package to install local peer-dependencies
JavaScript
7
star
60

fs.promises.exists

🪐 The missing fs.promises.exists(). Also supports case-sensitive/insensitive file paths.
TypeScript
7
star
61

vue-just-ssr

🔥 Instantly add a Vue SSR dev-env to your Webpack build
JavaScript
7
star
62

issue-reproductions

A repository to collect and organize my issue reproductions
JavaScript
6
star
63

webpack-analyze-duplication-plugin

Detect duplicated modules in your Webpack build
JavaScript
6
star
64

vue-feather-icon-set

Optimized Feather icon set for Vue using SVG references
JavaScript
6
star
65

is-fs-case-sensitive

Check whether the file-system is case-sensitive
TypeScript
6
star
66

npm-registry-sync

A daemon to sync packages across npm registries
TypeScript
6
star
67

babel-plugin-debug-object-location

Babel plugin to help you determine where an object or array was instantiated
TypeScript
5
star
68

generate-batched-pr-manifest

Generate a manifest of all the PRs included in a batched PR
TypeScript
5
star
69

entry-file-plugin

Create an ESM entry-file in your Webpack build to consolidate entry-point exports
TypeScript
5
star
70

privatenumber

5
star
71

webpack-dependency-size

👩‍🔬 Webpack plugin to get an overview of bundled dependencies and their size
JavaScript
5
star
72

vue-demo-collapse

Vue component that shows a demo and a "Show Code" button to expand source code
Vue
4
star
73

markdown-it-add-attrs

markdown-it plugin to add attributes to all rendered elements
JavaScript
4
star
74

browser-reload-plugin

Automatically reload the browser page on every Webpack watch build
JavaScript
4
star
75

rollup-playground

Demonstration of different Rollup configurations
JavaScript
3
star
76

rollup-plugin-htmlvue

Rollup plugin for transforming HTML/XML to Vue SFC
TypeScript
3
star
77

htmlvue-loader

Webpack loader for compiling HTML to Vue
JavaScript
3
star
78

vue-ast-utils

Utils for working with Vue 3 AST nodes
TypeScript
3
star
79

systemjs-unpkg

SystemJS extra to auto-resolve bare specifiers to UNPKG
JavaScript
3
star
80

web-diff

Visually diff web pages
JavaScript
2
star
81

rollup-plugin-aggregate-exports

Emit an entry file to aggregate exports across multiple files.
JavaScript
2
star
82

svg-trace-loader

Webpack loader to trace and flatten SVGs into one path
JavaScript
2
star
83

repkg

🚚 On-demand AMD npm package bundling service
JavaScript
2
star
84

postcss-custom-properties-transformer

PostCSS plugin to apply transformations to CSS custom properties (eg. mangling)
JavaScript
2
star
85

webpack-distsize

Track Webpack output size via version control
JavaScript
2
star
86

motion-orientation-api

Motion & Orientation API explorer
Vue
2
star
87

vue-server-renderer

JavaScript
2
star
88

postcss-import-alias

Use aliases in your PostCSS import statements
JavaScript
2
star
89

pm2-no-daemon-bug

JavaScript
1
star
90

resume

1
star
91

fs-router-patch

Add routing for shimming fs access
JavaScript
1
star
92

gulp-watchman

JavaScript
1
star
93

.github

1
star
94

sharp-vs-resvgjs

JavaScript
1
star
95

mempack

Run a Webpack build in-memory
JavaScript
1
star