Parallel Deflate issue in DotNetZip Library

For deployment packages we use DotNetZip Library to create zip files. One of the files recently became corrupted when put in the package.

7zip error

CRC error in 7zip

We investigated the changing of Compression Level and Compression Method. Which solved the issue but none were acceptable. See details in table below.

After finding more discussion on the issue (ZipFile.AddFile fails depending of the file size) We noted the file size was 1048576, which is 128 * 8 * 1024 and fits the problem with the parallel deflate compression method. The solution is to not use parallelism.

zip.ParallelDeflateThreshold = -1;

This dropped the performance to 41 sec, but that was acceptable.

Deflate level 0 Deflate (issue) No parallel BZip2
3 sec 19 sec 41 sec 71 sec
292 Mb 110 Mb 110 Mb 96 Mb

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s