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 steve.dower
Recipients Cezary.Wagner, docs@python, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-06-26.17:13:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593191602.82.0.90905326881.issue41106@roundup.psfhosted.org>
In-reply-to
Content
Those are all good ideas, but using os.stat(d) instead of d.stat() is shorter, more reliable, more compatible, and already works.

There's no middle ground where DirEntry can be faster, because it's already using that middle ground. All the discussion between Eryk and myself was figuring out whether we can use the DirEntry/FindFileData information to tell whether the file needs an explicit stat() or not, and we can't.

Most of the performance impact of stat() is just in opening the file (which scandir() does not do). As soon as we have to directly access the file, we may as well get all the information from it. We're already getting all the "cheap" information we can.
History
Date User Action Args
2020-06-26 17:13:22steve.dowersetrecipients: + steve.dower, paul.moore, tim.golden, docs@python, zach.ware, eryksun, Cezary.Wagner
2020-06-26 17:13:22steve.dowersetmessageid: <1593191602.82.0.90905326881.issue41106@roundup.psfhosted.org>
2020-06-26 17:13:22steve.dowerlinkissue41106 messages
2020-06-26 17:13:22steve.dowercreate