gh-140358: Bring back elapsed time and unreachable count to gc debug output#140359
gh-140358: Bring back elapsed time and unreachable count to gc debug output#140359pablogsal merged 14 commits intopython:mainfrom
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 |
Misc/NEWS.d/next/Core_and_Builtins/2025-10-20-11-24-36.gh-issue-140358.UQuKdV.rst
Outdated
Show resolved
Hide resolved
|
Please add test to |
|
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. |
IMHO it is better to use counter like in 3.13 vesion. |
|
@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. |
|
You need to use the |
|
@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.
|
This looks okay to me. |
|
This should be probably backported. @nascheme WDYT? |
|
@pablogsal @nascheme Thanks! |
|
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. |
|
Sorry, some misclicks. |
|
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.