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 barneygale, pitrou, remi.lapeyre, serhiy.storchaka, xtreak
Date 2020-03-09.17:07:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583773660.11.0.97698305007.issue39907@roundup.psfhosted.org>
In-reply-to
Content
> Less reliable how?

See issue39916.

> so it looks like scandir as a small overhead when accumulating all results and not using the extra info it returns.

Try with larger directories. The difference may be not so small.

$ python3 -m timeit -s 'from os import scandir' "list(scandir('/usr/include'))"
10000 loops, best of 3: 176 usec per loop
$ python3 -m timeit -s 'from os import listdir' "listdir('/usr/include')"
10000 loops, best of 3: 114 usec per loop
History
Date User Action Args
2020-03-09 17:07:40serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, remi.lapeyre, xtreak, barneygale
2020-03-09 17:07:40serhiy.storchakasetmessageid: <1583773660.11.0.97698305007.issue39907@roundup.psfhosted.org>
2020-03-09 17:07:40serhiy.storchakalinkissue39907 messages
2020-03-09 17:07:40serhiy.storchakacreate