Raymond Hettinger added the comment:

Hmm, the presense of _PyTuple_DebugMallocStats,  repeat_traverse, and 
visit_decref suggests that the profile may have been run with debugging code 
enabled and GC enabled.

The property patch looks good.  Depending on how far you want to go with this, 
you could save your tuple of length-1 statically and reuse it on successive 
calls if its refcnt doesn't grow (see the code for zip() for an example of how 
to do this).  That would save the PyTuple_New and tupledealloc calls.

Going further, potentially you could in-line some of the code it PyObject_Call, 
caching the callsite and its NULL check, and looking at the other steps to see 
if they are all necessary in the context of a property_desc_get().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23910>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to