I have a program which traverses directory trees and records the names of files that match certain criteria. This seemed like an ideal job for File::Find, and the program is fairly simple.
This program was running regularly and happily, then one day we need to run it on a load of remote drives. I mapped the drives and set off the program, it took three and a half hours to run.
A bit of testing showed that it was running at a rate of at least 1000 files a second when traversing the local drive, but this dropped to a blistering 0.5 files per second across a good connection and 0.11 files per second for a drive in the far east.
So what is going on here? I know it is slow to connect to a shared drive, but surely all it is doing is opening the directory and reading the file names? Are there any options in File::Find or any mods I can do to speed this up, or am I going to have to write my own directory traversing code instead?
--
iakobski
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.