Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Issue on covariance calculation

by rodion (Chaplain)
on Apr 13, 2007 at 08:53 UTC ( [id://609849]=note: print w/replies, xml ) Need Help??


in reply to Issue on covariance calculation

Opening and closing a file is quite time consuming on most operating systems. Your code opens and closes "Outfile.txt" 10,000 times, once for each input line. You also have to find the end of the file each time you open it, which will take quite a while as the file gets large.

Try taking the open and close for that file outside the "for my $element" loop, so it's opened and closed only once. That should speed things up a lot.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found