[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset d6fb53fe42d83a10f1372dd92ffaa6a01d2feffb by Victor Stinner in branch 'master': bpo-39465: Remove _PyUnicode_ClearStaticStrings() from C API (GH-20078) https://github.com/python/cpython/commit/d6fb53fe42d83a10f1372dd92ffaa6a01d2feffb --

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-13 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19384 pull_request: https://github.com/python/cpython/pull/20078 ___ Python tracker ___ __

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-12 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19366 pull_request: https://github.com/python/cpython/pull/20058 ___ Python tracker ___ __

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor
STINNER Victor added the comment: Attached bench.py: Micro-benchmark on _PyUnicode_FromId(). It requires attached bench.patch being applied. -- Added file: https://bugs.python.org/file49148/bench.patch ___ Python tracker

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file49147/bench.py ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +19357 pull_request: https://github.com/python/cpython/pull/20048 ___ Python tracker ___ __

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-40602: "Move Modules/hashtable.h to Include/internal/pycore_hashtable.h". -- ___ Python tracker ___ __

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4804b5b3df82e7892ca0550b02f902bcfc16bb48 by Victor Stinner in branch 'master': bpo-39465: Don't access directly _Py_Identifier members (GH-20043) https://github.com/python/cpython/commit/4804b5b3df82e7892ca0550b02f902bcfc16bb48 -- ___

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-05-11 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +19352 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20043 ___ Python tracker ___ _

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-02-08 Thread Nick Coghlan
Nick Coghlan added the comment: As Petr notes, as long as all subinterpreters share the GIL, and share str instances, then the existing _Py_IDENTIFIER mechanism will work fine for both single phase and multi-phase initialisation. However, that constraint also goes the other way: as long as w

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-02-06 Thread hai shi
hai shi 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, fo

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-01-30 Thread STINNER Victor
STINNER Victor added the comment: > AFAIK there is no problem now, except possibly a race condition when > initializing the identifiers. The GIL avoids any risk of race condition, no? -- ___ Python tracker ___

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-01-30 Thread Petr Viktorin
Petr Viktorin added the comment: > What is the problem between _Py_IDENTIFIER and multi-phase initialisation > modules? AFAIK there is no problem now, except possibly a race condition when initializing the identifiers. It seems it's too easy to conflate porting to multi-phase initialization

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-01-30 Thread STINNER Victor
STINNER Victor added the comment: > Both https://github.com/python/cpython/pull/18066 (collections module) and > https://github.com/python/cpython/pull/18032 (asyncio module) ran into the > problem where porting them to multi-phase initialisation involves replacing > their usage of the `_Py_

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-01-30 Thread STINNER Victor
STINNER Victor added the comment: Once I discussed with Eric Snow during a core developer sprint: _Py_IDENTIFIER() should use an "interpreter local storage" for identifiers values. _Py_IDENTIFIER() would only be a "key" and _PyUnicode_FromId() would store the value somewhere in a hash table

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-01-27 Thread Nick Coghlan
Change by Nick Coghlan : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue39465] Design a subinterpreter friendly alternative to _Py_IDENTIFIER

2020-01-27 Thread Nick Coghlan
New submission from Nick Coghlan : Both https://github.com/python/cpython/pull/18066 (collections module) and https://github.com/python/cpython/pull/18032 (asyncio module) ran into the problem where porting them to multi-phase initialisation involves replacing their usage of the `_Py_IDENTIFI