On Sat, Jul 4, 2020, at 14:27, William Pickard wrote:
There is only 2 ways an extension is distributed to people in the Python universe: As a SOURCE CODE distribution OR a COMPILED BINARY distribution.
Wheels are generally the "compiled" distribution, these are also generally built for a specific runtime + python version. For Python 3.10 wheels, these would already be compiled against the precompiled header.
For source distributions, they require "building" before being deployed, for Python 3.10, this will include the precompiled header.
My point was that I still don't understand what the benefit of the precompiled header is, if extensions still have to distribute source to get the benefit of it. This is why I assumed you *didn't* think extensions would have to distribute source. So, how is it better than a normal header? If the point of an opaque PyObject isn't to allow the same compiled distribution of an extension to be used with different versions of python that have different implementations of PyObject then... well, what *is* the point? Why not just recompile normally, with the textual header?
I'm aiming at least to not increase the API overhead for when invoking stuff like "Py_TYPE", "Py_INCREF", "Py_DECREF", etc. Py_INCREF and Py_DECREF are the worst offenders as they are generally HIGHLY INVOKED functions and are also the functions that are ALWAYS INLINE OPTIMIZED away by modern compilers.