This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hooft
Recipients
Date 2001-03-20.09:57:00
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
A lot of the time spent by glob.glob on large
directories is spent doing os.path.normcase(). Half of
this can be saved by normcasing the pattern only once,
and on unix the whole normcase call can be left out.

This patch attempts to optimize globbing even a bit
more by delegating the fnmatching of a list of file
names to a new function fnmatch.filter, which allows us
to move a few more lookups outside of the file name
loop.

Furthermore, an optimization is added to glob.glob
calls that do not contain any directory specifications,
saving a round of os.path.join calls.

Speedups of the pattern '*.py?' in the python lib
directory range
from a factor of 2 with directory specification to a
factor of 5 without directory specifications.

Unfortunately there is no test_glob regression test,
but I did my best to verify that nothing changed in my
calls.
History
Date User Action Args
2007-08-23 15:04:22adminlinkissue409973 messages
2007-08-23 15:04:22admincreate