On 1/24/07, Steffen Mueller <[EMAIL PROTECTED]> wrote:
It turns out that replacing the array implementation of
Archive::Zip::Archive with a hash-based or even Tie::IXHash-based
implementation speeds up the processing *tremendously*.

Now, for all our (i.e. PAR's) needs, this A::Z::Archive change would be
the perfect solution. Unfortunately, it breaks A::Z::Member's
encapsulation by associating the file name with the object outside of
the object. This bites if somebody does a $member->fileName("NewName").

I thought of this and discarded it for that exact reason.  With some
work, if A::Z::Archive were enhanced to add a "readonly" attribute
that specified that no changes would be made (and added checks to die
on attempts to do so), then the caching could be added in
A::Z::Archive.  But that's a lot of tests and code to write (but it
would benefit everyone who only uses A::Z to read zip files and not
write them).

I'd imagine it's easier to do this in PAR.pm where you know your
specific usage, know that it's read-only and can safely cache the
names.

David

Reply via email to