Zip Performance ZipLib vs ZipArchive (On .NET 4.5)

Sep 16, 2013 at 10:13 PM
Hi Guys,

I really love the ziplib library and want to use it in my application, but... i have a performance issue which i can't resolve and i don't know what the problem is.

I use the .NET 4.5 IO.Compression dll's

The same zip file with the .NET variant is 90% faster doesn't matter which file i take. Do you guys have any idee how i can speed up the unzip, am i doing something wrong?

this is the test code:

private void button2_Click(object sender, EventArgs e)
    {
        string zipPath = @"D:\Temp\AAHG_DAG_BF_20090401.zip";
        string extractPath = @"D:\Temp\UnpackMS";
        string extractPathIonic = @"D:\Temp\UnpackIonic";

        //string fileExtensionToUnpack = "dat";

        using (ZipArchive archive = System.IO.Compression.ZipFile.OpenRead(zipPath))
        {
            foreach (ZipArchiveEntry entry in archive.Entries)
            {
                entry.ExtractToFile(Path.Combine(extractPath, entry.FullName));
            }
        }

        using (Ionic.Zip.ZipFile archive = Ionic.Zip.ZipFile.Read(zipPath))
        {
            foreach (ZipEntry entry in archive.EntriesSorted)
            {
                entry.Extract(extractPathIonic);
            }
        }

    }
Oct 13, 2013 at 5:43 AM
I have an issue with DotNetZip. I deal with a large variety of zip files from various sources. About 3% of the files cannot be opened with DotNetZip. It throws an error stating something like "Cannot read as a zip file". However, the System.IO.Compression.ZipFile class can open and extract them just fine. I haven't been able to find any reasons for this.