[ scummvm-Patches-3048388 ] Hash map for ZipArchive class

SourceForge.net noreply at sourceforge.net
Thu Aug 19 08:30:53 CEST 2010


Patches item #3048388, was opened at 2010-08-19 16:30
Message generated for change (Tracker Item Submitted) made by dreammaster
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=3048388&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Paul Gilbert (dreammaster)
Assigned to: Nobody/Anonymous (nobody)
Summary: Hash map for ZipArchive class

Initial Comment:
I'd to submit some changes I've made to the unzip.cpp file class, to add a hash map of the file list, for peer review before committing it. The current sequential file search (done in unzLocateFile) is particularly problematic for the Broken Sword 2.5 engine, since the main Zip file is 700Mb in size, and each call to the method can take a second to run even on a fast computer. Not only that, but for a typical file access, the method gets called three times:
Once in a call the engine makes to see if the file exists (this could have been re-factored)
A second time when an ArchiveMemberPtr is created to the file
And finally a third time when the member is accessed to actually read the contents of the file.

I've wrapped my changes in several '#ifdef ZIP_HASH' blocks, so the old behavior could still be used if there's ever any need to disable it.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=3048388&group_id=37116




More information about the Scummvm-tracker mailing list