I don't understand why so many folks like these other modules when a simple find() will often do the job!
I guess the documentation could be improved?
File::Find is a core module and it runs really fast. My hint about this special underscore variable -> that can make a big difference. It took me awhile to learn that "trick", but I very sure that this is true. That is basically about a 2x performance increase if you are doing 2 file tests.
The overhead to call a subroutine with no args (which is what find() does), is pretty much nothing compared with a file system operation.
I'm not sure that running \$preprocess even helps in OP's application. Weirdly enough, it may actually be slower due to the processing before calling \$wanted(). But this depends upon how many files/directories are underneath the /advanced/ path's and whether pruning these descent path's out from the directory descent really helps. Also how significant are the number of simple files that are not log files? Maybe these are huge in number to the .log files, maybe not.
From my experience, the single thing that will drive the performance, is the number of stat(), file system operations.
|