You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the cpython codebase PyTuple_Pack is used at various places (https://github.com/search?q=repo%3Apython%2Fcpython+PyTuple_Pack&type=code). The execution is not very fast as the implementation uses va_arg internally. For the 1- and 2 argument case we can improve performance by providing a direct implementation.
Feature or enhancement
Proposal:
In the cpython codebase
PyTuple_Packis used at various places (https://github.com/search?q=repo%3Apython%2Fcpython+PyTuple_Pack&type=code). The execution is not very fast as the implementation usesva_arginternally. For the 1- and 2 argument case we can improve performance by providing a direct implementation.Using
PyTuple_Pack2(example implementation main...eendebakpt:cpython:putuple_pack2) performance of components likepairwisecan be improved. See https://discuss.python.org/t/nwise-itertools/51718/22Py_TuplePack1andPy_TuplePack2to the cpython interface? If so, should it be in the public or private API.Py_TuplePack2should we use it at all places applicable, or only the few performance critical ones?Py_TuplePack1that already exists is the internal_PyTuple_FromArraywith second argument1.Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response