[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

hai shi report at bugs.python.org
Thu Feb 6 21:59:23 EST 2020


hai shi <shihai1991 at 126.com> added the comment:

> The GIL avoids any risk of race condition, no?

Looks like the GIL would affect performance more or less?

>_Py_IDENTIFIER() would only be a "key" and _PyUnicode_FromId() would >store the value somewhere in a hash table stored in PyInterpreterState.

+1.

IMHO, for those two cases, the simplest idea is move IDENTIFIER to moduleState which would increase more memory usage than InterpreterState.

----------

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


More information about the Python-bugs-list mailing list