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 serhiy.storchaka
Recipients abacabadabacaba, benhoyt, serhiy.storchaka, vstinner
Date 2016-11-06.21:53:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478469234.59.0.00287175870654.issue25996@psf.upfronthosting.co.za>
In-reply-to
Content
Proposed patch adds support for file descriptors in os.scandir() and implements os.fwalk() with os.scandir().

The effect of using os.scandir() in os.fwalk():

$ ./python -m timeit -n1 -r5 -s 'import os' -- 'list(os.walk("/usr/lib"))'
1 loop, best of 5: 934 msec per loop

$ ./python -m timeit -n1 -r5 -s 'import os' -- 'list(os.walk("/usr/lib", topdown=False))'
1 loop, best of 5: 718 msec per loop

$ ./python -m timeit -n1 -r5 -s 'import os' -- 'list(os.fwalk("/usr/lib"))'
Unpatched: 1 loops, best of 5: 1.78 sec per loop
Patched:   1 loop, best of 5: 934 msec per loop

$ ./python -m timeit -n1 -r5 -s 'import os' -- 'list(os.fwalk("/usr/lib", topdown=False))'
Unpatched: 1 loops, best of 5: 1.76 sec per loop
Patched:   1 loop, best of 5: 947 msec per loop
History
Date User Action Args
2016-11-06 21:53:55serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, benhoyt, abacabadabacaba
2016-11-06 21:53:54serhiy.storchakasetmessageid: <1478469234.59.0.00287175870654.issue25996@psf.upfronthosting.co.za>
2016-11-06 21:53:54serhiy.storchakalinkissue25996 messages
2016-11-06 21:53:54serhiy.storchakacreate