Message257955
Proposed minimal patch implements globbing in pathlib using os.scandir(). Here are results of microbenchmarks:
$ ./python -m timeit -s "from pathlib import Path; p = Path()" -- "list(p.glob('**/*'))"
Unpatched: 598 msec per loop
Patched: 372 msec per loop
$ ./python -m timeit -s "from pathlib import Path; p = Path('/usr/')" -- "list(p.glob('lib*/**/*'))"
Unpatched: 1.33 sec per loop
Patched: 804 msec per loop
$ ./python -m timeit -s "from pathlib import Path; p = Path('/usr/')" -- "list(p.glob('lib*/**/'))"
Unpatched: 750 msec per loop
Patched: 180 msec per loop
See msg257954 in issue25596 for comparison with the glob module. |
|
| Date |
User |
Action |
Args |
| 2016-01-11 12:20:21 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, brett.cannon, pitrou, vstinner, benhoyt, ethan.furman |
| 2016-01-11 12:20:21 | serhiy.storchaka | set | messageid: <[email protected]> |
| 2016-01-11 12:20:21 | serhiy.storchaka | link | issue26032 messages |
| 2016-01-11 12:20:21 | serhiy.storchaka | create | |
|