On Tue, 31 Jul 2018 02:29:42 +0200 Victor Stinner firstname.lastname@example.org wrote:
Last year, I gave a talk at the Language Summit (during Pycon) to explain that CPython should become 2x faster to remain competitive. IMHO all attempts to optimize Python (CPython forks) have failed because they have been blocked by the C API which implies strict constraints.
Well, that's your opinion, but did you prove it?
I discussed with many Python developers who agree with me that the C API blocked CPython forks. For example, I heard that Pyston was very fast and very promising before starting to support the C API.
What exactly in the C API made it slow or non-promising?
The C API requires that your implementations make almost all the same design choices that CPython made 25 years ago (C structures, memory allocators, reference couting, specific GC implementation, GIL, etc.).
Yes, but those choices are not necessarily bad.
Multiple PyPy developers told me that cpyext remains a blocker issue to use PyPy.
Probably, but we're talking about speeding up CPython here, right?
If we're talking about making more C extensions PyPy-compatible, that's a different discussion, and one where I think Stefan is right that we should push people towards Cython and alternatives, rather than direct use of the C API (which people often fail to use correctly, in my experience).
But the C API is still useful for specialized uses, *including* for development tools such as Cython.
I agree about the overall diagnosis. I just disagree that changing the C API will open up easy optimization opportunities.
Actually I'd like to see a list of optimizations that you think are held up by the C API.
I have to confess that helping Larry is part of my overall plan.
Which is why I'd like to see Larry chime in here.