[issue40077] Convert static types to heap types: use PyType_FromSpec()

STINNER Victor report at bugs.python.org
Sat Oct 31 20:15:42 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

Count static types:

grep -E 'static PyTypeObject .* =' $(find -name "*.c"|grep -v Doc/)|wc -l

Count heap types:

grep -E 'PyType_Spec .* =' $(find -name "*.c")|wc -l

Status:

* 3.6: 10 heap (6%) vs 145 static (total: 155)
* 3.7: 10 heap (6%) vs 150 static (total: 160)
* 3.8: 15 heap (9%) vs 157 static (total: 172)
* 3.9: 39 heap (21%) vs 149 static (total: 188) -- 2.6x more heap types than 3.8!
* master: 69 heap (35%) vs 131 static (total: 200) -- 1.8x more heap types than 3.9!

The percentage of heap static is growing in the right direction ;-) The total number of types is also growing at each Python realease!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40077>
_______________________________________


More information about the Python-bugs-list mailing list