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 Cezary.Wagner
Recipients Cezary.Wagner, docs@python, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-07-01.11:25:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593602750.9.0.546653869114.issue41106@roundup.psfhosted.org>
In-reply-to
Content
As far as I know os.stat() resets d.stat() maybe should be added some option to d.stat() to force update(). d.stat(nt_force_update=True).

I am not sure if os.path.getmtime() can reset d.stat().

os.stat() is 2x times slower than os.path.getmtime() and os.path.getmtime is 16x slower than d.stat(). MAJOR PROBLEM is PERFORMANCE of os.stat() since for directories with 1000 files it takes big number of seconds to read all stats - something wrong is here I think since Windows Explorer is doing it very fast.

So I can not use os.stat() ONLY and it complicates code since I need to use os.stat() after d.stat() if files is OLDER THAN because if I use os.stat() the most program time will be these calls.

Do you know which code makes such reset of d.stat()?

If there is not possible optimization of there is need DOCUMENTATION update because it is really hard to understand why it is not working under windows some REMARKS can help me and others.

I have still believe that some optimization is possible for Windows.

Maybe it can be force to read stat by os.scandir(force_scan_stat=True) so all directory entries will be have cached stats before d.stat() is called. It can be faster I think since less calls from Python and probably better Windows API for it and same for Linux.

I will study C code later if it is possible or write some snippet.
History
Date User Action Args
2020-07-01 11:25:50Cezary.Wagnersetrecipients: + Cezary.Wagner, paul.moore, tim.golden, docs@python, zach.ware, eryksun, steve.dower
2020-07-01 11:25:50Cezary.Wagnersetmessageid: <1593602750.9.0.546653869114.issue41106@roundup.psfhosted.org>
2020-07-01 11:25:50Cezary.Wagnerlinkissue41106 messages
2020-07-01 11:25:50Cezary.Wagnercreate