in reply to Re: Re: opendir in file find
in thread opendir in file find
You can save a little overhead by reusing the stat buffer using the magical filehandle '_',
Yes and no. You can do that if you first disable File::Find's overeager "optimization" via:
If you don't do that first, then File::Find will skip doing lstat in some cases and your use of _ will give you stale data (data for the wrong file) in those cases.$File::Find::dont_use_nlink= 1;
I'd much rather you have to request this optimization when you want it (which, on some file systems, can speed up Find operations where you don't care about anything but the file name), but p5p seems pretty violently against making this "optimization" opt-in instead of opt-out.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^3: opendir in file find (anti-optimization effects)
by BrowserUk (Patriarch) on Jul 25, 2003 at 18:11 UTC | |
by tye (Sage) on Jul 25, 2003 at 18:21 UTC | |
by BrowserUk (Patriarch) on Jul 25, 2003 at 19:14 UTC |