On 1/24/07, Steffen Mueller <[EMAIL PROTECTED]> wrote:
Not really. As I said, A::Zip is pretty correct about encapsulation.
$_->fileName() in *this* loop is exactly what's causing the code to be
slow. This is a really tight loop. Replacing $_->fileName with
$_->{fileName} is a major performance improver. It's also bad code. The
question is: Should we pile yet another hack on top of the PAR Jenga
tower? Extraction performance is abysmal right now and it's crucial to
be reasonably fast.
I see -- I misunderstood your original post. I would rather see the
method call replaced with hash access within A::Zip and not in PAR.
While it's "bad", it's contained with A::Zip where the classes have to
be fairly well coordinated anyway. Having PAR break A::Zip's
encapsulation seems like a bad idea.
However, are there other things that could reduce some of the accessor
calls, like caching? I have a hard time imagining that there are PAR
files with 100K to 500K files contained within. (My entire perl
directory only seems to have about 4K files currently.)
Is _first_member is being called more than once for each zip file? If
so, I would suggest caching %names by zip file.
David
David