-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed as not planned
Labels
Description
Feature or enhancement
Proposal:
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.
Using PyTuple_Pack2 (example implementation main...eendebakpt:cpython:putuple_pack2) performance of components like pairwise can be improved. See https://discuss.python.org/t/nwise-itertools/51718/22
- Can we add
Py_TuplePack1andPy_TuplePack2to the cpython interface? If so, should it be in the public or private API. - If we add
Py_TuplePack2should we use it at all places applicable, or only the few performance critical ones? - An alternative for
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