Subject: | SYNOPSIS pod is horribly unoptimised |
The File::Find::Rule documentation currently encourages the use of the
FFR API in a resource-wasteful manner.
# find all the .pm files in @INC
my @files = File::Find::Rule->file()
->name( '*.pm' )
->in( @INC );
This example may read well, but it encourages the use of a highly
expensive filesystem test before a relatively cheap name test.
I would recommend that the ordering of the methods be reversed to have
the use of the name pattern BEFORE the filesystem test.
Even better would be if File::Find::Rule could automatically optimise
itself by reordering order-irrelevant conditions so that the ->name was
automatically moved to be before the ->file in all situations it was
desirable.
But that's another ticket. In the mean time, encouraging name tests
before filesystem tests should result in making many recursive-scanning
applications significantly faster.