-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Improve Windows performance of pathlib.Path.is_file and friends #101357
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixesOS-windowsperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Description
Activity
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixesOS-windowsperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Projects
- StatusShow more project fieldsDone
Feature or enhancement
We could implement / reuse the same fast paths that we did for
os.path.*in #101324 forpathlib.Path.*. It will require a little more work, since thepathlib.PathAPI can returnOSErrorunder certain circumstances, whereasos.pathwould returnFalsein those cases.Pitch
We saw a 12-25% speedup doing this for
os.path. It would be unfortunate if people chose the lower-level API for performance reasons becausepathlib.Pathdidn't match it in performance.Linked PRs
os.path.exists()etc from pathlib #101361OSErrorfrompathlib.Path.exists()andis_*()#118243