Why does Perl read certain files slooowly?

L

loiaconos

A script was very slow, so I used Time:HiRes to find out where it was
slow. Turns out it was reading each record in a file in 0.15 secs. This
is very slow compared to reads from a different file of 0.000037 per
read. The length of the records are similar.

So it takes 4054 times longer to read one of the records from the slow
file.

Anyone ever see this?

Any ideas?

Thanks!

Joe Loiacono
 
L

loiaconos

This is how I measured the read (time_check is a script that uses
Time::HiRes to measure elapsed time in microseconds):

while (<FLOWS>) {
time_check ("after read");
...
(a bunch of processing)
...
time_check ("before read");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top