summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2025-04-29 08:00:14 (GMT)
committerGitHub <noreply@github.com>2025-04-29 08:00:14 (GMT)
commit622300bdfa6242b0fc909235fcc64f07b3d280d7 (patch)
tree70f40299ae670af3c83ce31022e18bc62c07b421 /Python/bytecodes.c
parent01f11a0e4e8ae1132bd36d7f66af7d4dcc387d33 (diff)
downloadcpython-622300bdfa6242b0fc909235fcc64f07b3d280d7.zip
cpython-622300bdfa6242b0fc909235fcc64f07b3d280d7.tar.gz
cpython-622300bdfa6242b0fc909235fcc64f07b3d280d7.tar.bz2
GH-132554: Add stats for GET_ITER (GH-132592)
* Add stats for GET_ITER * Look for common iterable types, not iterator types * Add stats for self iter and fix naming in summary
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 40fb0d7..4e2dec7 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -3029,6 +3029,9 @@ dummy_func(
}
inst(GET_ITER, (iterable -- iter)) {
+ #ifdef Py_STATS
+ _Py_GatherStats_GetIter(iterable);
+ #endif
/* before: [obj]; after [getiter(obj)] */
PyObject *iter_o = PyObject_GetIter(PyStackRef_AsPyObjectBorrow(iterable));
PyStackRef_CLOSE(iterable);