Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How Could I Speed Up An Archive Script?

by chromatic (Archbishop)
on Jun 22, 2004 at 18:44 UTC ( [id://368817]=note: print w/replies, xml ) Need Help??


in reply to How Could I Speed Up An Archive Script?

I wonder if writing and rewriting the files is hurting you. Here's an untested simplification of the relevant section of your code:

while(my $file = ( <C:/data/*.log>, C<:/data/*.stderr> )) { # add all log files to zip file $file =~ s/C.*\///; $zip->addFile( $file ); } $zip->writeToFileNamed( $logname );

This'll only write the zip file once for each subroutine invocation. It may trade memory for speed, but I'm not sure how Archive::Zip handles open zip files internally, so it may be a moot point.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://368817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-24 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found