Skip to content

Commit 4bc2259

Browse files
authored
Merge pull request #210 from j9t/refactor/benchmarks-outsourcing
Outsource benchmarks
2 parents 7f32021 + d7ae07a commit 4bc2259

File tree

16 files changed

+254
-4783
lines changed

16 files changed

+254
-4783
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ updates:
77
schedule:
88
interval: "monthly"
99
- package-ecosystem: "npm"
10-
directory: "/benchmarks/"
10+
directory: "/backtest/"
1111
schedule:
1212
interval: "weekly"
1313
- package-ecosystem: "github-actions"

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
benchmarks/backtest/
2-
benchmarks/generated/
3-
benchmarks/sources/
1+
backtest/input/
2+
backtest/errors.log
3+
backtest/results.*
44
demo/build/
55
dist/
66
node_modules/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ As of version 2.0.0, all notable changes to HTML Minifier Next (HMN) are documen
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [5.0.4] - 2026-02-06
8+
9+
### Internal
10+
11+
* Outsourced benchmarks (now handled [in separate repository](https://github.com/j9t/minifier-benchmarks)) and refactored backtest
12+
* Updated benchmarks-related documentation
13+
714
## [5.0.3] - 2026-02-04
815

916
### Fixed

README.md

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -397,47 +397,7 @@ Available options:
397397

398398
## Minification comparison
399399

400-
How does HTML Minifier Next compare to other minifiers? (All minification with the most aggressive settings—though without [hyper-optimization](https://meiert.com/blog/the-ways-of-writing-html/#toc-hyper-optimized)—and against a wide range of pages.)
401-
402-
<!-- Auto-generated benchmarks, don’t edit -->
403-
| Site | Original Size (KB) | [HTML Minifier Next](https://github.com/j9t/html-minifier-next) ([config](https://github.com/j9t/html-minifier-next/blob/main/benchmarks/html-minifier.json))<br>[![npm last update](https://img.shields.io/npm/last-update/html-minifier-next)](https://socket.dev/npm/package/html-minifier-next) | [htmlnano](https://github.com/posthtml/htmlnano)<br>[![npm last update](https://img.shields.io/npm/last-update/htmlnano)](https://socket.dev/npm/package/htmlnano) | [@swc/html](https://github.com/swc-project/swc)<br>[![npm last update](https://img.shields.io/npm/last-update/@swc/html)](https://socket.dev/npm/package/@swc/html) | [minify-html](https://github.com/wilsonzlin/minify-html)<br>[![npm last update](https://img.shields.io/npm/last-update/@minify-html/node)](https://socket.dev/npm/package/@minify-html/node) | [minimize](https://github.com/Swaagie/minimize)<br>[![npm last update](https://img.shields.io/npm/last-update/minimize)](https://socket.dev/npm/package/minimize) | [html­com­pressor.­com](https://htmlcompressor.com/) |
404-
| --- | --- | --- | --- | --- | --- | --- | --- |
405-
| [A List Apart](https://alistapart.com/) | 63 | **53** | 55 | 56 | 55 | 58 | 56 |
406-
| [Apple](https://www.apple.com/) | 236 | **198** | 208 | 212 | 213 | 215 | 215 |
407-
| [BBC](https://www.bbc.co.uk/) | 648 | **603** | 614 | 609 | 610 | 643 | n/a |
408-
| [CERN](https://home.cern/) | 150 | **80** | 90 | 90 | 90 | 92 | 95 |
409-
| [CSS-Tricks](https://css-tricks.com/) | 155 | 127 | **121** | 136 | 137 | 141 | 138 |
410-
| [ECMAScript](https://tc39.es/ecma262/) | 7261 | **6447** | 6583 | 6465 | 6589 | 6637 | n/a |
411-
| [EDRi](https://edri.org/) | 80 | **68** | 69 | 69 | 71 | 74 | 72 |
412-
| [EFF](https://www.eff.org/) | 54 | **45** | 49 | 47 | 48 | 49 | 49 |
413-
| [European Alternatives](https://european-alternatives.eu/) | 48 | **30** | 32 | 32 | 32 | 32 | 32 |
414-
| [FAZ](https://www.faz.net/aktuell/) | 1523 | 1393 | **1367** | 1450 | 1461 | 1470 | n/a |
415-
| [French Tech](https://lafrenchtech.gouv.fr/) | 153 | **122** | 126 | 126 | 126 | 132 | 127 |
416-
| [Frontend Dogma](https://frontenddogma.com/) | 227 | **219** | 240 | 225 | 227 | 246 | 226 |
417-
| [Google](https://www.google.com/) | 18 | **16** | 17 | **16** | 17 | 18 | 18 |
418-
| [Ground News](https://ground.news/) | 1465 | **1328** | 1350 | 1372 | 1377 | 1452 | n/a |
419-
| [HTML Living Standard](https://html.spec.whatwg.org/multipage/) | 149 | 148 | 153 | **147** | 149 | 155 | 149 |
420-
| [Igalia](https://www.igalia.com/) | 49 | **34** | 36 | 36 | 36 | 37 | 37 |
421-
| [Leanpub](https://leanpub.com/) | 241 | **224** | 226 | 226 | 227 | 236 | 238 |
422-
| [Mastodon](https://mastodon.social/explore) | 38 | 35 | **32** | 35 | 36 | 37 | 37 |
423-
| [MDN](https://developer.mozilla.org/en-US/) | 109 | **63** | 64 | 65 | 65 | 68 | 68 |
424-
| [Middle East Eye](https://www.middleeasteye.net/) | 220 | **194** | 200 | 198 | 198 | 199 | 200 |
425-
| [Mistral AI](https://mistral.ai/) | 343 | **307** | **307** | 310 | 311 | 340 | n/a |
426-
| [Mozilla](https://www.mozilla.org/) | 47 | **32** | 35 | 35 | 35 | 36 | 36 |
427-
| [Nielsen Norman Group](https://www.nngroup.com/) | 97 | 73 | **59** | 78 | 80 | 81 | 81 |
428-
| [SitePoint](https://www.sitepoint.com/) | 494 | 456 | **430** | 468 | 473 | 491 | n/a |
429-
| [Startup-Verband](https://startupverband.de/) | 43 | **30** | 31 | **30** | 31 | 31 | 31 |
430-
| [TetraLogical](https://tetralogical.com/) | 59 | 52 | **49** | 51 | 53 | 53 | 53 |
431-
| [TPGi](https://www.tpgi.com/) | 173 | **157** | 164 | 163 | 164 | 170 | 170 |
432-
| [United Nations](https://www.un.org/en/) | 151 | **113** | 121 | 125 | 125 | 130 | 123 |
433-
| [Vivaldi](https://vivaldi.com/) | 93 | **76** | n/a | 79 | 81 | 84 | 82 |
434-
| [W3C](https://www.w3.org/) | 50 | **36** | 39 | 38 | 38 | 41 | 39 |
435-
| **Average processing time** | | 78 ms (30/30) | 169 ms (29/30) | 47 ms (30/30) | **15 ms (30/30)** | 276 ms (30/30) | 1296 ms (24/30) |
436-
437-
(Last updated: Feb 4, 2026)
438-
<!-- End auto-generated -->
439-
440-
Notes: Minimize does not minify CSS and JS. [HTML Minifier Terser](https://github.com/terser/html-minifier-terser) is currently not included due to issues around whitespace collapsing and removal of code using modern CSS features, issues which appeared to distort the data.
400+
Please see [**the Minifier Benchmarks project**](https://github.com/j9t/minifier-benchmarks) for details on how HMN compares to other minifiers.
441401

442402
## Examples
443403

@@ -641,27 +601,15 @@ For CLI usage, using a config file is strongly recommended to avoid complex shel
641601
npm run serve
642602
```
643603

644-
### Benchmarks
645-
646-
Benchmarks for minified HTML:
647-
648-
```shell
649-
cd benchmarks;
650-
npm i;
651-
npm run benchmarks
652-
```
653-
654-
(In case of dependency conflicts, run `npm i` with the `--legacy-peer-deps` flag.)
655-
656604
### Regression tests
657605

658606
```shell
659-
cd benchmarks;
607+
cd backtest;
660608
npm i;
661609
npm run backtest
662610
```
663611

664-
The backtest tool tracks minification performance across Git history. Results are saved in `benchmarks/backtest/` as CSV and JSON files.
612+
The backtest tool tracks minification performance across Git history. Results are saved in the backtest folder as CSV and JSON files.
665613

666614
Parameters:
667615

0 commit comments

Comments
 (0)