[Python-Dev] C API changes

Victor Stinner vstinner at redhat.com
Tue Nov 27 09:09:41 EST 2018


Le mar. 27 nov. 2018 à 01:13, Larry Hastings <larry at hastings.org> a écrit :
> (...) I'm not convinced the nice-to-have of "you can't dereference the pointer anymore" is worth this runtime overhead.

About the general idea of a new C API.

If you only look at CPython in release mode, there is no benefit. But
you should consider the overall picture:

* ability to distribute a single binary for CPython in release mode,
CPython in debug mode, PyPy, and maybe some new more funky Python
runtimes
* better performance on PyPy

The question is if we can implement new optimizations in CPython (like
tagged pointer) which would move the overall performance impact to at
least "not significant" (not slower, not faster), or maybe even to
"faster".

Note: Again, in my plan, the new C API would be an opt-in API. The old
C API would remain unchanged and fully supported. So there is no
impact on performance if you consider to use the old C API.

Victor


More information about the Python-Dev mailing list