minify-html/bench/README.md

44 lines
1.8 KiB
Markdown
Raw Normal View History

2020-01-24 09:04:07 -05:00
# Benchmarking
2020-07-11 11:29:34 -04:00
This folder contains scripts used to test the performance and effectiveness of minify-html, for guided optimisation and/or comparisons.
2020-01-24 09:04:07 -05:00
2021-08-09 05:30:27 -04:00
It also contains a set of common web pages as inputs for benchmarking.
2020-01-24 09:04:07 -05:00
## Comparison
2021-08-09 05:24:43 -04:00
Each minifier is run against each file in the [inputs](./inputs) folder, which are HTML pages fetched from popular websites:
2020-01-24 09:04:07 -05:00
|File name|URL|
|---|---|
|Amazon|https://www.amazon.com/|
|BBC|https://www.bbc.co.uk/|
|Bootstrap|https://getbootstrap.com/docs/3.4/css/|
|Bing|https://www.bing.com/|
|Coding Horror|https://blog.codinghorror.com/|
2020-01-24 09:06:04 -05:00
|ECMA-262|https://www.ecma-international.org/ecma-262/10.0/index.html|
2020-01-24 09:04:07 -05:00
|Google|https://www.google.com/|
|Hacker News|https://news.ycombinator.com/|
|NY Times|https://www.nytimes.com/|
|Reddit|https://www.reddit.com/|
|Stack Overflow|https://www.stackoverflow.com/|
|Twitter|https://twitter.com/|
|Wikipedia|https://en.wikipedia.org/wiki/Soil|
**Note that these pages are already mostly minified.**
2021-08-09 05:30:27 -04:00
For more information on how the inputs are fetched, see [fetch.js](./fetch.js).
2020-01-24 09:04:07 -05:00
2021-08-09 05:30:27 -04:00
On this [project's README](../README.md), average graphs are shown. Graphs showing per-input results are shown below:
2020-01-24 09:04:07 -05:00
2023-05-07 08:34:04 -04:00
<img width="435" alt="Chart showing speed of HTML minifiers per input" src="https://wilsonl.in/minify-html/bench/0.11.1/core/speeds.png"><img width="435" alt="Chart showing effectiveness of HTML minifiers per input" src="https://wilsonl.in/minify-html/bench/0.11.1/core/sizes.png">
2020-01-24 09:04:07 -05:00
2021-08-09 05:24:43 -04:00
Results depend on the input, so charts show performance relative to minify-html as a percentage.
2020-01-24 09:04:07 -05:00
## Running
2021-08-09 05:24:43 -04:00
Run [build](./build) to build the minifiers.
2020-01-24 09:04:07 -05:00
2021-08-09 05:30:27 -04:00
Run [run](./run) to benchmark each HTML minifier against each input and output the results to the `results` folder.
2020-01-24 09:04:07 -05:00
2021-08-09 05:30:27 -04:00
Run [graph.js](./graph.js) to render graphs to the `graphs` folder.