[Python-Dev] Making PyInterpreterState an opaque type
Armin Rigo
armin.rigo at gmail.com
Thu Feb 21 08:58:49 EST 2019
Hi,
On Tue, 19 Feb 2019 at 13:12, Victor Stinner <vstinner at redhat.com> wrote:
> Please don't use &PyTuple_GET_ITEM() or _PyTuple_ITEMS(). It prevents
> to use a more efficient storage for tuple. Something like:
> https://pythoncapi.readthedocs.io/optimization_ideas.html#specialized-list-for-small-integers
>
> PyPy already has the issue right now.
Just to clarify PyPy's point of view (or at least mine):
1. No, it no longer has this issue. You can misuse
``&PyTuple_GET_ITEM()`` freely with PyPy too.
2. This whole discussion is nice but is of little help to PyPy at this
point. The performance hit comes mostly from emulating reference
counting and non-movable objects. If the API was half the size and
did not contain anything with irregular behavior, it would have made
our job easier in the past, but now it's done---and it wouldn't have
improved the performance of the result.
A bientôt,
Armin.
More information about the Python-Dev
mailing list