Skip to content

andrew-aladev/brotli-vs-zstd

Repository files navigation

Comparison of brotli and zstd

There are similar bindings for ruby: ruby-brs and ruby-zstds, it supports streaming API. It is possible to make easy benchmark between brotli and zstd.

Installation

You need to install recent version of sparsehash, brotli, zstd, image magick and ruby.

gem install bundler
bundle install

Samples

Please download recent versions of google fonts, static HTML dump of wikipedia and cdnjs.

git clone [email protected]:google/fonts.git --depth=1
rm -rf fonts/.git

mkdir wikipedia
wget "https://dumps.wikimedia.org/other/static_html_dumps/current/eu/wikipedia-eu-html.tar.7z"
7z x -so wikipedia-eu-html.tar.7z | tar xf - -C wikipedia
rm wikipedia-eu-html.tar.7z

git clone [email protected]:cdnjs/cdnjs.git --depth=1
rm -rf cdnjs/.git
./scripts/util/cleanup_cdnjs.sh cdnjs

Benchmark

Please run prepared process scripts.

./scripts/data/google_fonts.sh /mnt/data/fonts
./scripts/data/wikipedia.sh /mnt/data/wikipedia
./scripts/data/cdnjs.sh /mnt/data/cdnjs

Accurate performance measurement requires running in single thread, so processing takes a lot of time.

It will populate results and update data folder. You can add your own custom script, please look at scripts inside scripts/data folder.

Chart

Please run prepared process scripts.

./scripts/chart/google_fonts.sh
./scripts/chart/wikipedia.sh
./scripts/chart/cdnjs.sh

It will populate charts and update chart folder. You can add your own custom script, please look at scripts inside scripts/chart folder.

Chart folder path consist of name/extension/type/chart_type, files inside may be from_size - to_size.webp or all.webp. For example chart folder path cdnjs/js/min/ratio, file inside 64 KiB - 128 KiB.webp.

type may be any/min/not_min. Please read more about chart_type in lib/chart/process.rb.

Example:

Example chart

License

MIT license, see LICENSE, AUTHORS and NOTICE.

About

Comparison of brotli and zstd

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published