GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — bpo-40170: PyType_HasFeature() no longer acccess directly tp_flags by vstinner · Pull Request #19378 · python/cpython Conversation
|
|
I expect no significant performance difference or a very low overhead for macros and functions using PyType_HasFeature(). PyType_HasFeature() is used by the following code in header files:
PyType_FastSubclass() is used by many PyXXX_Check() macros:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@serhiy-storchaka @methane: Do you expect such change to have an impact on performance? What do you think of the change? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Some |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes, that's possible but I would prefer to add new functions to the internal C API for that. For example, add a fast In the past, I tried to reuse the same name for two implementation of the same function: one "slow" using a function call, one "fast" using a macro or static inline function. I'm thinking at PyThreadState_GET(). The internal C API uses: The problem is that depending if the internal C API is included or not, you may get the slow or the fast function. I changed my approach: use a different name for the fast function. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PyType_HasFeature() now always calls PyType_GetFlags() to hide implementation details. Previously, it accessed directly the PyTypeObject.tp_flags member when the limited C API was not used. Add fast inlined version _PyType_HasFeature() and _PyType_IS_GC() for object.c and typeobject.c.
|
@methane: I added fast inlined version _PyType_HasFeature() and _PyType_IS_GC() for object.c and typeobject.c. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…gs() (pythonGH-19378)" (pythonGH-21390) This partially reverts commit 45ec5b9. (cherry picked from commit b26a0db) Co-authored-by: Victor Stinner <[email protected]>
…gs() (GH-19378)" (GH-21390) This partially reverts commit 45ec5b9. (cherry picked from commit b26a0db) Co-authored-by: Victor Stinner <[email protected]>
…gs() (pythonGH-19378)" (pythonGH-21390) This partially reverts commit 45ec5b9.
…gs() (pythonGH-19378)" (pythonGH-21390) This partially reverts commit 45ec5b9.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.