Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-140358: Bring back elapsed time and unreachable count to gc debug output#140359
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
Conversation
pgdr commented Oct 20, 2025 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Misc/NEWS.d/next/Core_and_Builtins/2025-10-20-11-24-36.gh-issue-140358.UQuKdV.rst Outdated Show resolvedHide resolved
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sergey-miryanov commented Oct 20, 2025
Please add test to |
Uh oh!
There was an error while loading. Please reload this page.
pgdr commented Oct 20, 2025
I'm not sure if it is appropriate to use the performance counter or the monotonic (raw). I currently chose monotonic raw, whereas the Python 3.13 version has performance counter. |
sergey-miryanov commented Oct 20, 2025
IMHO it is better to use counter like in 3.13 vesion. |
pgdr commented Oct 20, 2025
@sergey-miryanov Thanks a lot for all the comments. I believe all issues you pointed to are addressed now. A test has been added, and I included the checking of the other lines in the test as well. I also moved to using performance counter. |
Uh oh!
There was an error while loading. Please reload this page.
sergey-miryanov commented Oct 20, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
You need to use the |
pgdr commented Oct 20, 2025
@efimov-mikhail I believe I have addressed all your comments, but I still have a doubt regarding including |
efimov-mikhail commented Oct 20, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I think so. CI is green for this PR. And we don't include this file in And cpython/Include/cpython/pytime.h Line 10 in 237dca5
It's part of the public Python C API, as well as |
efimov-mikhail left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the PR!
But we have to wait for some Core Developers.
nascheme commented Oct 20, 2025
This looks okay to me. |
b2f9fb9 into python:mainUh oh!
There was an error while loading. Please reload this page.
pablogsal commented Oct 20, 2025
This should be probably backported. @nascheme WDYT? |
sergey-miryanov commented Oct 21, 2025
@pablogsal@nascheme Thanks! |
pgdr commented Oct 21, 2025
efimov-mikhail commented Oct 21, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
IMO, we can consider this a bug, since removing @pablogsal@nascheme |
Thanks @pgdr for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, @pgdr and @pablogsal, I could not cleanly backport this to |
Thanks @pgdr for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…debug output (pythonGH-140359) (cherry picked from commit b2f9fb9) Co-authored-by: Pål Grønås Drange <paal.drange+pgdr@gmail.com>
GH-140405 is a backport of this pull request to the 3.14 branch. |
efimov-mikhail commented Oct 21, 2025
Sorry, some misclicks. |
nascheme commented Oct 21, 2025
FWIW, I think backporting is a good idea. It's a small change and it only affects people who turn this option on. Thanks for fixing this. |
Fixes#140358
This code includes
pycore_time.hingc.cand times the run of_PyGC_Collect. If_PyGC_DEBUG_STATS, then we print the total time used:E.g.
See also discussion at elapsed time debugging in gc.c at discuss.