New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accelerate mimetypes.init on Windows #88748
Comments
mimetypes.init is slow on Windows because of the big registry search, which involves touching thousands of entries in order to add a few hundred into the initial table. Things get even worse when audit hooks are enabled, because the winreg methods need to be hooked. However, we know that this particular operation is coming from core, and so we could skip these hooks. Both issues can be trivially solved (helped) with a native accelerator function. |
It's only a rough benchmark, but my timings for Since that includes all of startup, it's actually a better than 50% reduction for mimetypes.init(). I'm happy to take that without questioning precisely how much better it is ;) |
mimetypes doesn't really support clearing, but Without the accelerator: 133ms |
Dropping the 3.9 backport. Pretty sure it only needs a clinic regen, but it's also not worth the risk of changed behaviour. We could consider it again after 3.10 has shipped if people really want it (and can help validate it). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: