DotNetZip 1.9 vs 1.8 compression ratio

May 11, 2010 at 7:41 PM


   I am testing version after using

   I run the same code with both:

zipFile = new ZipFile(Encoding.GetEncoding("ibm437"))) 



   The directory uncompressed size is about 3.6 GB. 

   With version I get a zip file with size 297.206 MB

   With version I get a zip file with size 325.571 MB 

   When I view the zip file with WinZip I see that for some files the ratio was better in 1.8. 

    Can you explain ? (BTW 1.9 was much faster but did in come with prise?)  



May 11, 2010 at 8:18 PM

Yes, v1.9 offers a trade of compression speed for compressed size.  If you want the v1.8 behavior, set the ParallelDeflateThreshold on the ZipFile instance., to -1. 

I debated (with myself!) whether to make by default, bias toward SPEED or bias toward SIZE, but I could not find a good reason to make either choice. In the end I decided to turn on parallel deflate because the speed was so enticing.


May 12, 2010 at 8:49 AM

Thanks Cheeso for the quick response! 

From my example we gained about 40% improvements in performance for about 10% degradation in compression. 

My question is, must it be all or nothing or is there something in between like: 

30% performance improvement for 5% compression degradation? 

BTW changing the CompressionLevel in the ZipFile had no effect. 



May 12, 2010 at 3:42 PM

With the property I mentioned you can tweak things.
But of course the results will depend on the files you are compressing. 
The only way to know, is to test it. 
See the documentation for more information.