You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add -X importtime=2 for additional logging when an imported module is already loaded #102567
Add special handling for -X importtime=2 that provides additional output when already-loaded modules are imported. This will allow users to get a complete picture of runtime imports.
Pitch
While -X importtime is incredibly useful for analyzing module import times, by design, it doesn't log anything if an imported module has already been loaded. -X importtime=2 would provide additional output for every module that's already been loaded:
In codebases with convoluted/poorly managed import graphs (and consequently, workloads that suffer from long import times), the ability to record all paths to an expensive dependency–not just the first-imported–can help expedite refactoring (and help scale identification of this type of issue). More generally, this flag would provide a more efficient path to tracking runtime dependencies.
The changes required are largely unintrusive: here's my reference implementation: [will relink, need to do some paperwork].
@willingc Hey Carol, tagging you based on our recent conversation. We need some clarification on how to fill out the CLA before we can start contributing code to CPython; I'll quote the questions my colleague had directly (cc @tjstum):
The form has a field for "bugs.python.org username." My understanding is that Python has ceased using this site and uses GitHub Issues and Pull Requests instead (the header on that website says the same). How should I fill out that field?
Additionally, how do we indicate that a particular individual's GitHub account is associated with our entity's signed CLA? We have a GitHub organization, but individuals from our organization would be submitting Pull Requests using their own personal GitHub accounts. It wasn't totally clear to me how to go about this process.
We tried reaching out to the PSF directly around the time this issue was created but didn't get a response. Thanks!
Activity
noahbkim commentedon Nov 15, 2023
@willingc Hey Carol, tagging you based on our recent conversation. We need some clarification on how to fill out the CLA before we can start contributing code to CPython; I'll quote the questions my colleague had directly (cc @tjstum):
We tried reaching out to the PSF directly around the time this issue was created but didn't get a response. Thanks!
vstinner commentedon May 29, 2024
Can you paste an example of output before and after for comparison? You propose to add "cached" lines?
gh-102567: Add -X importtime=2 for logging an importtime message for …
gh-102567: Add missing newline to `--help-all` (GH-136391)
pythongh-102567: Add missing newline to `--help-all` (pythonGH-136391)
[3.14] gh-102567: Add missing newline to `--help-all` (GH-136391) (GH…
pythongh-102567: Add missing newline to `--help-all` (pythonGH-136391)
pythongh-102567: Add -X importtime=2 for logging an importtime messag…
pythongh-102567: Add missing newline to `--help-all` (pythonGH-136391)
pythongh-102567: Add missing newline to `--help-all` (pythonGH-136391)
pythongh-102567: Add missing newline to `--help-all` (pythonGH-136391)
pythongh-102567: Add missing newline to `--help-all` (pythonGH-136391)