[issue36030] add internal API function to create tuple without items array initialization

STINNER Victor report at bugs.python.org
Thu Feb 21 10:20:55 EST 2019


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

> Once I had wrote a similar patch that adds PyTuple_FromArray, but never published it because I did not found enough use cases for this function.  Although I considered using it only for removing some code duplication, but Sergey shown that it can be used for small performance boost in some special cases. I am still not sure, but this argument makes this change a tiny bit more attractive. Leave this on Raymond.

The micro-benchmark results are not really impressive. I still like PR 11954 because it removes code (simply loops). _PyTuple_FromArray() has a well defined API and is safe (I'm saying that because PR 11927 adds an "unsafe" function). As soon as it's private, I'm fine with it.

I'm more attracted by the code simplification than performance boost here.

----------

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


More information about the Python-bugs-list mailing list