[Python-Dev] Making PyInterpreterState an opaque type

Brett Cannon brett at python.org
Thu Feb 21 17:12:08 EST 2019

On Thu, Feb 21, 2019 at 6:01 AM Armin Rigo <armin.rigo at gmail.com> wrote:

> 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.

While it's unfortunate we start this conversation back when PyPy started to
suffer through this so that we could try to make it easier for them, I
don't want people to think trying to come up with a simpler FFI API
eventually wouldn't be beneficial to other implementations (either ones
that haven't reach Python 3 yet or have not even been written).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190221/935ca552/attachment-0001.html>

More information about the Python-Dev mailing list