Skip Menu |
 

This queue is for tickets about the IO-Compress CPAN distribution.

Report information
The Basics
Id: 87517
Status: open
Priority: 0/
Queue: IO-Compress

People
Owner: Nobody in particular
Requestors: kwilliams [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Listing members is pretty slow
Download (untitled) / with headers
text/plain 671b
I'm using a simple loop to get the names of members in an archive, like so: my $zip = IO::Uncompress::Unzip->new(shift); my $status; for ($status = 1; $status > 0; $status = $zip->nextStream()) { my $name = $zip->getHeaderInfo()->{Name}; say "Processing member $name" ; last if $status < 0; } It's pretty slow when it encounters large members, so I'm guessing it's scanning through the whole record rather than seeking to each record's start. Is that correct? Is there some opportunity for improvement there? BTW I'm using version 2.033, not the latest, because I'm having some trouble upgrading (see https://rt.cpan.org/Ticket/Display.html?id=87516). Thanks.
Download (untitled) / with headers
text/plain 1.1k
On Thu Aug 01 11:56:04 2013, KWILLIAMS wrote: Show quoted text
> I'm using a simple loop to get the names of members in an archive, > like so: > > my $zip = IO::Uncompress::Unzip->new(shift); > my $status; > for ($status = 1; $status > 0; $status = $zip->nextStream()) { > my $name = $zip->getHeaderInfo()->{Name}; > say "Processing member $name" ; > last if $status < 0; > } > > It's pretty slow when it encounters large members, so I'm guessing > it's scanning through the whole record rather than seeking to each > record's start. Is that correct?
Yep. The default assumption with the IO::Compress::Unzip is that the file is being streamed, so scanning the record is what has to happen. Show quoted text
>Is there some opportunity for > improvement there?
Indeed there is - it's been on my todo list for a while to allow streaming mode to be optional with IO::Compress::Unzip. Will move it up the list. Show quoted text
> BTW I'm using version 2.033, not the latest, because I'm having some > trouble upgrading (see > https://rt.cpan.org/Ticket/Display.html?id=87516).
I'll reply to that separately. Show quoted text
> Thanks.
Sorry for the delay in responding - been away for a couple of weeks with no internet connection. cheers Paul


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.