-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
GH-140638: Add a GC "duration" stat
#141720
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
| * ``uncollectable`` is the total number of objects which were found | ||
| to be uncollectable (and were therefore moved to the :data:`garbage` | ||
| list) inside this generation. | ||
| list) inside this generation; |
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.
| list) inside this generation; | |
| list) inside this generation. |
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.
I just did this for consistency with the above points, haha.
Python/gc_free_threading.c
Outdated
| assert(PyList_CheckExact(gcstate->callbacks)); | ||
| PyObject *info = NULL; | ||
| if (PyList_GET_SIZE(gcstate->callbacks) != 0) { | ||
| info = Py_BuildValue("{sisnsn}", |
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.
You need to change this line to
| info = Py_BuildValue("{sisnsn}", | |
| info = Py_BuildValue("{sisnsnsd}", |
no?
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.
Nice catch, thanks. Annoying that it just ignores trailing args like that.
pablogsal
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 I left some comments
This adds a useful
"duration"stat togc.get_statsandgc.callbacks. It also fixes an issue where the existing timer could be used uninitialized if the GC's debug flags are set during a collection.durationandvisitedto thegc.callbacksandgc.get_stats()dicts #140638📚 Documentation preview 📚: https://cpython-previews--141720.org.readthedocs.build/