0

I need to create a huge archive (uncompressed) from a directory on disk, preferably using C#. I've tried DotNetZip, ZipArchive and manually doing it with WinRAR. WinRAR is blazing fast by comparison to the other two. Using DotNetZip, this is my code:

using (var zip = new ZipFile())
{
    zip.CompressionLevel = CompressionLevel.None;
    zip.AddDirectory("mydirectory");
    zip.Save("savedirectory");
}

It works, and is easy but it's way too slow. I can start a process and do this using rar.exe from WinRAR, but I also would like to track progress reading the directory and saving the archive. All of which I get from DotNetZip.

Is there a way via options to speed my work up with DotNetZip? Or to track progress via rar.exe if kicked off with a process?

Or are there other packages I should look at? Commercial is fine too, I don't mind paying if it's fast.

Nicros
  • 4,811
  • 12
  • 56
  • 100
  • Related: [How do I create 7-Zip archives with .NET?](http://stackoverflow.com/q/222030/119527) – Jonathon Reinhart Jul 02 '14 at 01:15
  • "Uncompressed"? - [tar](http://en.wikipedia.org/wiki/Tar_%28computing%29) is probably the most well known format - so search for C# implementations http://www.bing.com/search?q=c%23+tar. – Alexei Levenkov Jul 02 '14 at 01:32
  • The question isn't about how to do it, it's about the performance. I know how to do it, but it's too slow. Did you guys read the question? – Nicros Jul 02 '14 at 05:29
  • @Nicros Of course, I was merely presenting alternatives for you to try- imI'm not going to measure all of their speeds for you. And Alexi was making the point that you're using a compression format to create an uncompressed blob - which is what tar is good at. Comments are for just this: information that isn't an explicit answer but is hopefully useful. – Jonathon Reinhart Jul 02 '14 at 14:10
  • @JonathonReinhart Thanks. Are you saying tar is faster than zip when dealing with uncompressed data? The question is still about performance, and the implementations I describe above- DotNetZip vs WinRAR. Right now I'm trying to find out why it's so different. Apples to apples. – Nicros Jul 02 '14 at 16:09
  • Ok, so I did some additional benchmarks, and DotNetZip is NOT slower- it was something I was doing that was slowing it down (handling too many events). – Nicros Jul 02 '14 at 16:50
  • @Nicros Just want to point out that there are no events in the code you've shown, so it would have been pretty unlikely that anyone could have helped you with this, given the information shown here. – Jonathon Reinhart Jul 02 '14 at 19:00

0 Answers0