Swaagie / minimize

Minimize HTML
MIT License
162 stars 18 forks source link

Benchmarks #25

Open austinpray opened 9 years ago

austinpray commented 9 years ago

Hello,

Due to some discussion over on the generator-gulp-webapp repo I have inadvertantly created some benchmarks for you. I noticed the benchmarks section on your readme was blank, so perhaps you now have some data to add.

The benchmark tool is here: https://github.com/austinpray/html-minifier-tests

My results are here: csv and json

graph

For a bit of discussion on what the "percent saved" metric is: https://github.com/yeoman/generator-gulp-webapp/issues/215#issuecomment-61386663

Example data:

Action Savings
Nothing 0%
Minify 35.15%
Gzip 70.44%
Gzip and Minify 77.60%
∆ Gz and Gz+Min 7.16%

Compared to leaving the html file alone and minifying there is only a 7.16% difference once gzip is added to the equation.

Ultimately it seems like the larger the html file the less of a difference minifying the html makes. This make sense due to the way the gzip algorithm makes.

Swaagie commented 9 years ago

Thanks for this! Haven't got around to actually doing benchmarks indeed. In the original discussion I read someone would like a blog post about it. I'll definitly add these (with proper attribution ofcourse), but keep me posted if you do decide to do the blog post as well.

Also I can relate to your results, the net result in bytes saved is pretty minimal even with smaller html files. Orginally this was just done to maximize the performance of page speed alongside heavy mem-caching of all static pages of www.nodejitsu.com. It's capacity to clean up messy html is still pretty strong though. I think I should redo the readme to also include some other use cases. Also I'll try to add some actual ops/cycle benchmarks with comparisons to other minifiers (if they are out there)

austinpray commented 9 years ago

Cool beans, that all sounds good. I'm working on the blog post right now so I will sling that your way when it is done. 

— Sent from my iPhone

On Mon, Nov 3, 2014 at 2:41 AM, Martijn Swaagman notifications@github.com wrote:

Thanks for this! Haven't got around to actually doing benchmarks indeed. In the original discussion I read someone would like a blog post about it. I'll definitly add these (with proper attribution ofcourse), but keep me posted if you do decide to do the blog post as well.

Also I can relate to your results, the net result in bytes saved is pretty minimal even with smaller html files. Orginally this was just done to maximize the performance of page speed alongside heavy mem-caching of all static pages of www.nodejitsu.com. It's capacity to clean up messy html is still pretty strong though. I think I should redo the readme to also include some other use cases. Also I'll try to add some actual ops/cycle benchmarks with comparisons to other minifiers (if they are out there)

Reply to this email directly or view it on GitHub: https://github.com/Moveo/minimize/issues/25#issuecomment-61450866