Repository navigation
Speed up glob.glob() by reducing number of system calls made #116380
Copy link
Copy link
Open
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Description
Activity
- addedperformancePerformance or resource usagePerformance or resource usage
on Mar 5, 2024 - changed the title
[-]Speed up `glob.glob()`[/-][+]Speed up `glob.glob()` by reducing number of system calls made[/+]on Mar 22, 2024 - added 5 commits that reference this issue
on Apr 5, 2024 37 remaining items
Given #116392 reduced system calls by changing design, would it be possible to add a test so that it doesn't accidentally revert? Tests are editable if a better / faster set of system calls is found, helps ensure changes are intentional. I improved the infrastructure to make this sort of testing possible a bit ago, happy to help implement:
system call checking infrastructure: https://github.com/python/cpython/blob/main/Lib/test/support/strace_helper.py
sample test: https://github.com/python/cpython/blob/main/Lib/test/test_fileio.py#L365-L498- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Mar 1, 2025
Metadata
Metadata
Assignees
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Projects
- StatusShow more project fieldsDone
It should be possible to speed up
glob.glob()using a few strategies developed in pathlib.Linked PRs
glob.glob()by removing some system calls #116392glob.glob0()andglob.glob1(). #117305dir_fdargument inglob._Globber. #117737include_hiddenargument inglob._Globber. #117738pathlib._glob#118562pathlib._glob#118678globtopathlib._abc. #120011test_iglob_iter_closetest #130710glob.[i]glob()by making fewer system calls. (#116392)" #130743glob.[i]glob()by making fewer system calls (take 2) #137474