Uh oh!
There was an error while loading. Please reload this page.
gh-140358: Bring back elapsed time and unreachable count to gc debug output - #140359
Conversation
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.
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.
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 |
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.
LGTM. Thanks for the PR!
But we have to wait for some Core Developers.
nascheme
commented
Oct 20, 2025
This looks okay to me. |
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
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.