This project benchmarks JavaScript minifiers, comparing their performance on various popular libraries. It aims to help developers choose the best minifier for their needs by providing data on minified size, gzipped size, and processing time.
How It Works
The project executes each minifier in a separate process with a 10-second timeout, verifying artifact integrity before and after minification. Minifiers are minimally configured (disabling sourcemaps and comments) to reflect an out-of-the-box experience. Benchmarks are updated automatically via GitHub Actions and PRs, with raw data available in /packages/data/data/data.json
.
Quick Start & Requirements
- Install/Run: The project is designed for benchmarking and does not provide a direct installation command for general use. Running the benchmarks requires Node.js and potentially other build tools.
- Prerequisites: Node.js.
- Setup: Refer to the project's internal scripts for detailed setup and execution instructions.
Highlighted Details
- Benchmarks include @tdewolff/minify, bun, oxc-minify, @swc/core, esbuild, terser, uglify-js, google-closure-compiler, babel-minify, and tedivm/jshrink.
- Metrics focus on minified size, minzipped size (Gzip compression), and minification time, with multipliers relative to the fastest minifier.
- Results are presented for popular libraries like React, Moment, jQuery, Vue, Lodash, D3, Terser, Three, Victory, Ant Design, and TypeScript.
- @swc/core is highlighted as a top performer for balancing size and speed, while @tdewolff/minify excels in speed and uglify-js in compression.
Maintenance & Community
- Benchmarks are updated on every PR via GitHub Actions.
- No specific community links (Discord/Slack) or roadmap are mentioned in the README.
Licensing & Compatibility
- The README does not explicitly state a license.
Limitations & Caveats
- Some minifiers, like babel-minify, google-closure-compiler, and uglify-js, timed out or failed on larger or more complex libraries, indicating potential limitations or lack of production readiness for certain use cases.
- Bun failed post-validation on typescript, suggesting potential issues with multi-line strings.