minification-benchmarks  by privatenumber

JS minification benchmark of popular tools

created 5 years ago
1,473 stars

Top 28.4% on sourcepulse

GitHubView on GitHub
Project Summary

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.
Health Check
Last commit

19 hours ago

Responsiveness

1 day

Pull Requests (30d)
32
Issues (30d)
3
Star History
30 stars in the last 90 days

Explore Similar Projects

Starred by George Hotz George Hotz(Author of tinygrad; Founder of the tiny corp, comma.ai), Anton Bukov Anton Bukov(Cofounder of 1inch Network), and
16 more.

tinygrad by tinygrad

0.1%
30k
Minimalist deep learning framework for education and exploration
created 4 years ago
updated 8 hours ago
Feedback? Help us improve.