ComparisonofBrotli,Deflate,Zopfli,LZMA,LZHAM
andBzip2CompressionAlgorithms
JyrkiAlakuijala,EvgeniiKliuchnikov,ZoltanSzabadka,andLodeVandevenne
Google,Inc.
Abstract—This paper compares six compression techniques, and based on the results
proposes that brotli could be used as a replacement of the common deflate algorithm.
We compared the performance of brotli by measuring the compression ratio and speed,
as well as decompression speed on three different corpora: the Canterbury compression
corpus, an ad hoc crawled web content corpus, and enwik8. On all three corpora we
show performance superior to that of deflate. Further, we show that Zopfli, LZMA,
LZHAM and bzip2 use significantly more CPU time for either compression or
decompressionandcouldnotalwaysworkasdirectreplacementsofdeflate.
Introduction
Muchofthepracticallosslessdatacompressionisdonewiththedeflatealgorithm,notonly
becauseitiswellsupportedbyexistingsystems,butalsobecauseitisrelativelysimpleandfast
toencodeanddecode.In2013welaunchedZopfli[1],acompressionalgorithmthatallowsfor
densercompressionwhileremainingcompatiblewiththedeflateformat.WhileZopfliisnow
wellacceptedinthefield,therewereopinionsexpressedthatweshouldmoveonfromthe
deflatefileformattoamodernsolution.Brotli[2]isourattemptatbuildingacompressionformat
andanexampleimplementationofthisformatthatisfundamentallymoreefficientthandeflate.
Inthispaperwemeasuretheperformanceofourimplementationandcompareitwithdeflate
andafewothercompressionalgorithms.
Methods
Thetestswererunwitha22bitwindowsizeforbrotli,LZMAandLZHAM,anda15bitwindow
sizefordeflateandzopfli.Weuseda22bitwindowsizebecausepastexperienceshowedthat
largerwindowscanbeslowertodecode.Largerwindowsizestendtogiveahigher
compressionratioattheexpenseofdecodingspeed.Fordeflateandzopfliweusedthe
maximumsizeallowedbytheformat.Theversionsofthealgorithmstestedare:
评论2