Google launches Zopfli, a better zip compressor for static content

Google launches Zopfli, a better zip compressor for static content

Summary: The venerable DEFLATE algorithm just got better thanks to a new open-sourced project from Google, but it is not without its costs.

SHARE:
4

What is known as ZIP to most of us, is actually the DEFLATE algorithm, and Google has made it slightly better.

The search giant announced Zopli today, which is a new compression algorithm that is compatible with existing DEFLATE decoders, and produces slightly smaller files at the cost of increased CPU load during compression.

Google said that the smaller files produced by Zopfli will result in faster data transmission, lower web page load latencies, and reduced battery use in mobiles.

An example of the cost and benefits can be found in a four page paper authored by Google. In it, four data sources are used: the homepages of 9,148 out of the 10,000 most popular websites; two collections of files known as the Calgary Corpus and the Canterbury Corpus; and enwik8, 100MB of Wikipedia. These files are run through gzip, 7-zip, kzip at maximum compression settings, with Zopfli using its default settings.

At the end of the tests, Zopfli files come out 3.7-8.3 percent smaller, but the computational time needed to compress Zopfli is 81 times more than what gzip needs.

Uncompressing the files is a different story, with Zopfli being the fastest of the tight bunch of results.

Based on these results, Google is recommending Zopfli for a particular use case.

"In the light of the results we presented, we recommend Zopfli for compression of static content, and other content where data transfer or storage costs are more significant than the increase in CPU time," the report suggested. "To our knowledge, Zopfli typically produces the highest compression density of any deflate-compatible algorithm."

Clearly this is not a general use algorithm, but for those designers and developers that are obsessive about shaving a few bytes here and there on images and files, it could be a good alternative.

The fact that a new inflater is not needed, means that Zopfli is ready to use today and that client-side applications need not be updated. A good approach that means that the vast majority of internet users need not know or care of its existence, but it has a chance to be a viable tool for cutting a little bit of cost from traffic-heavy websites.

The CPU intensity/secret sauce in Zopfli is its more exhaustive compression techniques that are "based on iterating entropy modelling and a shortest path search algorithm to find a low bit cost path through the graph of all possible deflate representations".

Zopfli is licensed under the Apache Licence 2.0.

Topics: Google, Web development

About

Chris started his journalistic adventure in 2006 as the Editor of Builder AU after originally joining CBS as a programmer. After a Canadian sojourn, he returned in 2011 as the Editor of TechRepublic Australia, and is now the Australian Editor of ZDNet.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

4 comments
Log in or register to join the discussion
  • what is the point?

    DEFLATE is actually quite archaic alogithm. A lot of other algorightms exist, that are way better than it in compression ratio, such as BZIP(2) and LZMA(2) etc. These are certainly more than 3.7-8.3 percent better than DEFLATE.
    danbi
    • Agree - sort of

      I have not done a comparison in a decade or so, but I always use rar archives. In conjunction with a small par archive, they are a phenomenal tool for transmitting or storing compressed files. I never worry about archive corruption and loss of data.
      D.T.Long
      • I highly recommend 7z format (lzma)

        it works faster and produces smaller archives than rar. I think WinRAR supports it as well but I prefer the UI from 7-zip.org
        vpupkin
    • The web browser is the point

      All modern web browsers have Deflate inflaters built into them, meaning you can serve zipped up content to them.

      That's why it is recommended for static web content
      Chris Duckett