[issue35059] Convert Py_INCREF() and PyObject_INIT() to inlined functions

STINNER Victor report at bugs.python.org
Fri Nov 23 07:17:33 EST 2018


STINNER Victor <vstinner at redhat.com> added the comment:

Unexpected cool effect of static inline functions (copy of my email):
https://mail.python.org/pipermail/python-dev/2018-November/155747.html

Le jeu. 15 nov. 2018 à 01:06, Gregory P. Smith <greg at krypto.org> a écrit :
> I expect the largest visible impact may be that a profiler may now attribute CPU cycles takes by these code snippets to the function from the .h file rather than directly to the functions the macro expanded in in the past due to additional debug symbol info attribution. Just more data. Consider that a win.

Oh. That's very interesting.

I just tried gdb and I confirm that gdb understands well inlined
function. When I debug Python, gdb moves into Py_INCREF() or
Py_DECREF() when I use "next".

I also tried perf record/perf report: if I annotate a function
(assembler code of the function), perf shows me the C code of inlined
Py_INCREF and Py_DECREF!

That's nice!

Victor

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35059>
_______________________________________


More information about the Python-bugs-list mailing list