in reply to RE: RE: RE: Descending through directories
in thread Getting a List of Files Via Glob

I finally got off my lazy back and ran the test on my home machine, a trusty P-100 with 80 MB RAM, and here are the results (with ActivePerl 5.005_03 build 517):

FAT 16 drive (no HD activity during the second run)
t1: 17 wallclock secs ( 6.66 usr +  9.89 sys = 16.55 CPU)
t2: 16 wallclock secs ( 5.89 usr +  8.47 sys = 14.36 CPU)
t3: 41 wallclock secs (16.67 usr + 18.16 sys = 34.83 CPU)
t4: 27 wallclock secs ( 8.37 usr + 16.88 sys = 25.26 CPU)
t5: 15 wallclock secs ( 7.75 usr +  7.07 sys = 14.82 CPU)
NTFS drive (slight HD activity for the later parts of the HD)
t1: 96 wallclock secs (30.07 usr + 59.09 sys = 89.17 CPU)
t2: 87 wallclock secs (27.73 usr + 53.18 sys = 80.91 CPU)
t3: 179 wallclock secs (72.02 usr + 96.92 sys = 168.94 CPU)
t4: 142 wallclock secs (36.63 usr + 96.15 sys = 132.78 CPU)
t5: 81 wallclock secs (35.33 usr + 43.25 sys = 78.58 CPU)

So here File::Find is again on par with the solution reading any directory twice and the solution using rewinddir(), and my favourite method of doing stuff, &t4 dosen't look that good either if you are going for peak performance. The fastest solution takes only half the time, and scanning the whole NTFS HD did take some time as you see :). So once again the rule number one of optimizing holds. Benchmark, benchmark, benchmark.

Replies are listed 'Best First'.
RE: Benchmarks under NT 4.0 SP3
by t0mas (Priest) on Jun 04, 2000 at 12:35 UTC
    Thanks Corion for the testing.
    As you say - Benchmark, benchmark, benchmark. Speed is the King many circumstances, but maybe not all. It seems that t1,t2, and t5 is best in this simple kind of searches, but in more complex cases with lots of heavy evaluations and fileops, t3 and t4 (or a more complex t5) is perhaps better.

    /brother t0mas