Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #19707 |

    I have scoured the forums, and found one post that has something regarding the speed of processing zip files.

    It doesn’t seem to apply to how I am doing the zipping.

    The files in question are txt files.

    here is my code:
    Public Sub ZipFile(ByVal strFile As String, ByVal strZipFile As String, ByVal bolRemoveOrig As Boolean)

    Xceed.Zip.QuickZip.Zip(strZipFile, strFile)

    If (File.Exists(strZipFile) And bolRemoveOrig) Then
    End If
    Catch ex As Exception
    End Try

    End Sub

    As you can see, I have my own “wrapper” to the function. Sometimes I need to remove the original sometimes I don’t.

    The zip process above is reasonable for files <100k. but a 1MB file takes forever to zip. There isn’t anything that I am seeing that will speed that up.

    Any pointers?

    The same is true when I use similar code to zip a directory.

    I have another issue whereby I move a bunch of files on the network to another location on the network, and that is pretty slow as well. I don’t have enough knowledge of the Xceed sets to know if there may be a faster method other than the built in method “File.Copy” … I have to do each file in succession, testing for source & destination (so I can throw the right exception when the source doesn’t exist, or the destination already does, or if the copy failed).

    Any help with the two issues would be appreciated!


    Imported from legacy forums. Posted by bsenff (had 5634 views)

    User (Old forums)
    Post count: 23064

    just bumping the thread, anyone have advice?

    Imported from legacy forums. Posted by bsenff (had 651 views)

    User (Old forums)
    Post count: 23064

    Are the files being zipped coming from the network? Can you send us a file that takes long to zip, along with the code snippet you use to zip it? You can send it to <a href=””>support</a>.

    Imported from legacy forums. Posted by André (had 296 views)

    User (Old forums)
    Post count: 23064

    Unfortunately I can’t give a copy of the file I am zipping.

    However, I can give characteristics.

    The files are all normal text files. Each line is 3500 characters wide, with varying amounts of whitespace vs. text.

    The largest file size so far is just shy of 6MB.

    The file does indeed reside on the network, however the size isn’t substatial enough for me to say it is network congestion or issue transferring. I can move the file from the network and desktop instantly.

    Using an XP machine and right clicking to zip in the OS itself is instant for the PC, but for the app it is agonizingly slow. (I don’t have any variance from file to file on time, if they are the same size, it always takes the same time).

    The code snippet used is exactly what I posted above. I pass the pertinent information to a subroutine, and use that routine to call quickzip — the routine is there because I will need to do more manipulation on the original file after zipping. For now, that routine only zips, and removes the original if the routine is passed a True boolean.

    Hopefully that helps. I’ll work to see if there is a way to get a sanitized version of the file, but seeing as all of the data in these files is sensitive, I’m not sure how successful I will be. Especially since the line count is something like 4000 lines of text 3500 characters wide.


    Imported from legacy forums. Posted by bsenff (had 596 views)

    User (Old forums)
    Post count: 23064

    Do you zip each file in a new zip archive, or are you adding each file to an already existing archive?

    Is there a large amount of files in the directory where the file to be zip is located?

    We have tried to reproduce here, using QuickZip to zip a file which has characteristics similar to the files you described in your last post, over the network, and it worked fine, the file was zipped within seconds.

    Imported from legacy forums. Posted by André (had 374 views)

    User (Old forums)
    Post count: 23064

    Yes, it is a new archive every time.

    There are less than 15 files in the directory where the text file resides.

    Are there any performance characteristics that are stored when a zip is created? (that I can access). I’m curious just what amount of time is spent in cpu, network transfer, and file read/write.. (as well as total time to zip).

    I’m really at a loss, there doesn’t seem to be any reason this would be so slow.


    Imported from legacy forums. Posted by bsenff (had 546 views)

    User (Old forums)
    Post count: 23064

    There is no performance monitors included with the library. However, there are events that you can use to identify which part of the zipping is taking so long. You will have to change the way you do things though, since the events are not available with the QuickZip class.

    You will need to use the FileSystem classes. For example :

    ZipEvents events = new ZipEvents();
    events.ByteProgression += new ByteProgressionEventHandler(events_ByteProgression);
    //add all the events on this object
    //events.ItemProgession += …

    AbstractFile source = new DiskFile( strFile );
    AbstractFile zip = new DiskFile( strZipFile );
    ZipArchive archive = new ZipArchive( zip );

    source.CopyTo( events, null, archive, true );

    //Have a handler for every event
    private static void events_ByteProgression(object sender, ByteProgressionEventArgs e)
    Console.WriteLine( e.CurrentItem.ToString() );
    //or update a UI telling you how much byte is being process for a specific item.

    For more details on the events available, here are links to our online help documentation :

    <a href=””></a&gt;
    <a href=””></a&gt;

    You can also look at our sample explorer for example on our to use the FileSystem classes and events.

    Go to Start Menu -> All Programs -> Xceed Components -> Our components in action! -> Xceed FileSystem Snippet Explorer.

    Then click on topic “3. Zip capabilities”. In the sub topics, you can look at the C# or VB.NET code, you can execute it, and you can even modify the code and execute it after.

    Imported from legacy forums. Posted by André (had 6005 views)

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