Message363753
> 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 |
|
Date |
User |
Action |
Args |
2020-03-09 17:07:40 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, remi.lapeyre, xtreak, barneygale |
2020-03-09 17:07:40 | serhiy.storchaka | set | messageid: <1583773660.11.0.97698305007.issue39907@roundup.psfhosted.org> |
2020-03-09 17:07:40 | serhiy.storchaka | link | issue39907 messages |
2020-03-09 17:07:40 | serhiy.storchaka | create | |
|