GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Optimize makedirs on Windows · Issue #101358 · python/cpython Open Labels OS-windowsperformancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement DescriptionI've been working to improve the performance of some Python workflows on Windows, and I found that a noticeable amount of time was being spent in I some more profiling on the venv create scenario, and learned that roughly 1/3rd of the stat cost can be solely attributed to the exists check in makedirs (src). (Which is being called by compile here, and from my cursory glance at that code, it should simply be passing exist_ok=True rather than catching FileExistsError, right?). What makes this especially wasteful is that this run contained 1451 calls to makedirs and 1455 calls to makedir, implying that the exists check was making things worse, rather than helping. Put another way, exists is taking nearly as much time as mkdir here. While it's true that if/when we get And in this case, we should allow makedirs on Windows to execute in an idiomatically performant way. And that is to simply call
It's probably worth splitting off a Windows-specific implementation of makedirs into the native side (posixmodule.c ?) so that we don't depend on raising a relatively expensive FileNotFoundError. (Forked from discussion on #101196) Activity
MetadataMetadataAssigneesLabelsOS-windowsperformancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement Projects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |