Why does Perl read certain files slooowly?

Discussion in 'Perl Misc' started by loiaconos, Apr 14, 2006.

  1. loiaconos

    loiaconos Guest

    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
     
    loiaconos, Apr 14, 2006
    #1
    1. Advertisements

  2. loiaconos

    loiaconos Guest

    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");
    }
     
    loiaconos, Apr 14, 2006
    #2
    1. Advertisements

  3. loiaconos

    loiaconos Guest

    PLEASE IGNORE!!!

    Confused myself with location of time checks.

    PLEASE IGNORE!!!
     
    loiaconos, Apr 14, 2006
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.