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
Measure if _warnings.c is still worth having #69126
Comments
_warnings.c was initially created to help with startup performance. It turned out to be a tricky bit of code to get right to continue to support the Python version of the module. But now that we live in a world where we have startup benchmarks instead of hunches and we freeze code like importlib, maybe it's time to re-evaluate whether warnings.py is such a bad thing to have as part of the startup process? I would be curious to know what the performance impact is if we made _warnings the frozen version of warnings.py instead of the C code and measured the startup performance. |
I should also mention the other motivating factor was providing C access to the warnings system, but once again importlib blazed that trail already by providing a C API which simply uses the Python code. |
Here are the benchmark results of freezing warnings.py as _frozen_warnings (very quick hack which doesn't use _frozen_warnings is attached). Basically -S slows down by about 3% and normal startup has no measurable impact. Not sure if that's worth it to simplify the warnings code or not. INFO:root:Automatically selected timer: perf_counter Report on Darwin Bretts-MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64 i386 ### startup_nosite ### The following not significant results are hidden, use -v to show them: |
After thinking about it and with _warnings.c not exactly changing very much I think I'm going to call YAGNI on ripping out _warnings.c. |
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: