Skip to content
No description, website, or topics provided.
Ruby C++ Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This tool tests the compression ratio and speed of Brotli at various levels compared to Zlib (Gzip) level 6. The resources used to test compression are HTML, JS, and CSS taken from the websites in the sites.txt list.

The Brotli library is taken from the git repo at This repo is a wrapper on the core Brotli code (from which compiles and installs a library that can be used in any C/C++ program.

To install libbrotli, first make sure you have libtool, autoconf and automake installed. Then:

git clone
cd libbrotli
git checkout e992cce
sudo make install

The actual compression test is performed by the program defined in The steps are:

  1. Read the file contents into memory.
  2. Take a timestamp to mark the start of the test.
  3. Compress the file 100 times using Brotli level 1.
  4. Take a timestamp to mark the end of the test.
  5. Record the compressed file size and compression speed (in MB/s).
  6. Repeat steps 2-5 for Brotli level 2-11.
  7. Repeat steps 2-5 for Gzip level 6.
  8. Output the results in JSON format.

The Ruby program brotli_test.rb calls brotli-test once for each file under the resources directory, stores the raw results in the file results/raw_results.json, and then processes the data to generate the final results as CSV files in the results folder. The CSV files can be imported into a spreadsheet like Google Docs.

Running the test

Clone this git repo:

git clone

Enter the brotli-perf-test folder:

cd brotli-perf-test

Populate the resources directory from the websites listed in sites.txt like this:


Compile the brotli-test executable:


Run the test:

ruby brotli_test.rb


Copyright 2016 Akamai Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You can’t perform that action at this time.