Archived Forum Post

Index of archived forum posts

Question:

Inflate Speeds

Jul 27 '15 at 13:25

I am converting from loading data (stock data) from text files to loading from an encrypted zip file for security reasons. However loading the data from the zip file using ckzip.GetEntryByName() and ckzipentry.Inflate() function takes about 5 times as long as just loading the data directly from the text files.

Any tips or tricks to speeding up the process?

I've tested using non encrypted zip files and the speed is the same (slow).


Answer

The load of 3400 stocks now takes 49 seconds instead of 12. Performance analysis shows that the 37 extra seconds breakdown as follows: OpenSize function takes 15 seconds, GetEntryByName takes 20 seconds and Inflate takes 2 seconds.

So this is good news, in that if I can open the zip file only once, and access the files by index instead of name I might be able to trim down the time required.

Question: how can I check if a zip file is already open so I don't open it again? I'm access the zip file 3400 times to get a random selection of files. Also, I see the GetEntryByIndex() of the file once I have retrieved it once by Name, so how I can access it subsequent times by index. I only see a GetEntryID property -- there is no GetEntryIndex property.