[New-bugs-announce] [issue26032] Use scandir() to speed up pathlib globbing

Guido van Rossum report at bugs.python.org
Wed Jan 6 17:55:27 EST 2016


New submission from Guido van Rossum:

The globbing functionality in pathlib (Path.glob() and Path.rglob()) might benefit from using the new optimized os.scandir() interface. It currently just uses os.listdir(). The Path.iterdir() method might also benefit (though less so).

There's also a sideways connection with http://bugs.python.org/issue26031 (adding an optional stat cache) -- the cache could possibly keep the DirEntry objects and use their (hopefully cached) attributes. This is more speculative though (and what if the platform's DirEntry doesn't cache?)

----------
messages: 257653
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: Use scandir() to speed up pathlib globbing
type: performance
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26032>
_______________________________________


More information about the New-bugs-announce mailing list