Message257955
| Author |
serhiy.storchaka |
| Recipients |
benhoyt, brett.cannon, ethan.furman, gvanrossum, pitrou, serhiy.storchaka, vstinner |
| Date |
2016年01月11日.12:20:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1452514821.4.0.115798593828.issue26032@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|