What is Brotli compression?
Brotli compression is an open source compression algorithm developed by Google to help further reduce the size of files. Google released a different compression algorithm in 2013 called Zopli to perform "very good but slow deflate or zlib compression". However, based on a compression algorithm study done at Google, Brotli came out significantly faster with a 20-26% increase in compression ratio compared to Zopli.
The higher data density is achieved by a 2nd order context modeling, re-use of entropy codes, larger memory window of past data and joint distribution codes.
Brotli is a whole new data format that is able to achieve compression ratios similar to other of the best comparable compression methods.
Brotli compression highlights
Compression has come a long way in the past couple of years and Brotli is now at the forefront in that category. Here are a few of the highlights that make Brotli a leader in compression:
- Brotli is independent of CPU type, operating system, file system, and character set.
- It can produce a compression ratio that is comparable to the best compression methods currently available and most importantly is considerably better than Gzip.
- It decompresses much faster than current LZMA implementation.
The results from Google's compression algorithm study on the Canterbury corpus is shown in the image below. From this, we can see that Brotli produced the best results in compression ratio, compression speed, and decompression speed. The varying numbers beside the compression algorithms define the quality settings for each algorithm. The compression team also carried out two additional tests. One of which was comprised of a sample of 1285 HTML documents with 93 different languages, while the other was based on a enwik8 file.
Why is Brotli important?
The Brotli compression algorithm is a noteworthy advancement since by reducing file sizes it will help make the web a faster and more enjoyable place for users - especially true for mobile users. As Zoltan Szabadka, a software engineer on Google's compression team said,
We hope that this format will be supported by major browsers in the near future, as the smaller compressed size would give additional benefits to mobile users, such as lower data transfer fees and reduced battery use.
While the use of compression can be utilized for a multitude of purposes, the ever growing mobile market may take advantage of improved compression the most.
If you're interested in learning more about Brotli compression, a detailed explanation of what Brotli entails is discussed in the Brotli documentation.