Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Faster unzip operations?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20326 |

    I’m using very simple code to unzip files.  Here is a sample:

            private AbstractFile zipFile;
            private ZipArchive archive;
            private ZippedFolder folderArchive;
     …
                    this.zipFile = new DiskFolder(zipPath).GetFile(zipFileName);
                    this.archive = new ZipArchive(this.zipFile);
     …
     // Unzip the file               
                    AbstractFolder dest = new DiskFolder(destinationFolder);
                    this.archive.CopyFilesTo(dest, true, true);
     

    Then I modified by adding one line:

            private AbstractFile zipFile;
            private ZipArchive archive;
            private ZippedFolder folderArchive;
     …
                    this.zipFile = new DiskFolder(zipPath).GetFile(zipFileName);
                    this.archive = new ZipArchive(this.zipFile);
                    archive.TempFolder = new MemoryFolder();
     …
     // Unzip the file               
                    AbstractFolder dest = new DiskFolder(destinationFolder);
                    this.archive.CopyFilesTo(dest, true, true);
     

    That didn’t make any difference to the time needed to unzip, though.

    Is there any way to speed up the process?  We deal with zips of varied sizes.  They probably will never get above 100MB, but we still need the process to be blazingly fast.  It is currently taking an average of about 20 sec to unzip files that are on average 20MB.  That comes out to about 1MB/second and I really need to improve that speed if possible.

     

    Imported from legacy forums. Posted by Nancy (had 1660 views)

    Xceed Support
    Member
    Post count: 5658

    The TempFolder isn’t used when unzipping. So speed will not change if you modify it.

    Your code is fine. There’s not much else you can do to speed it up.

    I agree that 20 seconds does seem somewhat slow for 20MB.

    The internal buffer size used in all methods like CopyTo() and CopyFilesTo() is small, which probably impacts performance. Unfortunately, there’s no way to change it.

    Is your zip file and/or destination folder on a network share? That would make file operations slow.

    What compression method is used on the items? Some compression algorithms like BZip2 and PPMd are slower than Deflated for example.

    From your sample code, the items don’t seem to be encrypted. That would have been a factor as well.

    How many items does your zip archive have? The ZipArchive constructor reads the “central directory” of the archive and builds a map of names and offset location of each item in the archive. There is a speed penalty for this when there is a large amount of items.

    The fastest unzipping we can offer comes from our Real-Time Zip component. It has less functionality than the full Zip for .NET and is more low-level but does not read the central directory, performs the fewest operations before decompressing data and you control the buffer size.

    We suggest you try the component to see if it better fits your speed requirements.

    Information and documentation:
    http://xceed.com/ZipRT_Net_Intro.html
    http://doc.xceedsoft.com/products/XceedRTZip/
    http://doc.xceedsoft.com/products/XceedRTZip/ZipReader_class.html

    Imported from legacy forums. Posted by Alain [Xceed] (had 350 views)

    User (Old forums)
    Member
    Post count: 23064

    Our zip files contain subfolders.  It appears that your real-time zip component will not handle subfolders, so it looks like we are not going to be able to speed up our unzip times.  That is very unfortunate.  Do you have any other suggestions that might help us?

    Imported from legacy forums. Posted by Nancy (had 1538 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.