https://github.com/guoyunhe/benchmark-js-minifiers
compare performance of js minifiers: terser, esbuild and swc
https://github.com/guoyunhe/benchmark-js-minifiers
Last synced: 3 months ago
JSON representation
compare performance of js minifiers: terser, esbuild and swc
- Host: GitHub
- URL: https://github.com/guoyunhe/benchmark-js-minifiers
- Owner: guoyunhe
- License: gpl-3.0
- Created: 2022-03-21T11:30:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-26T03:29:42.000Z (about 3 years ago)
- Last Synced: 2025-01-10T17:40:06.209Z (5 months ago)
- Language: JavaScript
- Size: 187 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Benchmark JavaScript Minifiers
Compare performance of terser, esbuild and swc as minifiers
## Sample Code
antd + lodash + react + react-dom + three.js
## Integrations
Use webpack + terser-webpack-plugin, which support terser, swc and esbuild minifier.
## Output Standard
- Bundled into one JS file with webpack
- IIFE format output
- Minified without source maps## Test Devices
### ThinkPad T480
System information:
- CPU: i7-8550U
- RAM: 32 GB 2667 MHz DDR4
- Node: 16.14.1
- OS: openSUSE Tumbleweed Linux 5.16.14Benchmark results:
1. esbuild: 5.615s, 1.9MB
2. swc: 8.997s, 1.9MB
3. terser: 17.046s, 1.8MB
4. no-minify: 4.677s, 4.7MB### MacBook Pro 16 (2019)
System information:
- CPU: i7-9750H
- RAM: 16 GB 2667 MHz DDR4
- Node: 16.14.0
- OS: macOS Monterey 12.2.1Benchmark results:
1. esbuild: 4.052s, 1.9MB
2. swc: 6.892s, 1.9MB
3. terser: 13.834s, 1.8MB
4. no-minify: 3.556s, 4.7MB## Summary
Only based on my test, may be not true for your real-world projects.