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 — gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot by neonene · Pull Request #124163 · python/cpython Conversation
|
|
I'll check this and PoC version again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
I have just one style suggestion. But if you'd like to keep it we can merge the PR as it is.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| return -1; | ||
| } | ||
|
|
||
| if (!_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) { |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
When I observed a good performance, the line had a typo (missing a NOT), though check_base_by_token() was unused during a PGO test. The telco got slower by 5-10% once I corrected, which was actually fixed by one of the following:
Use if-else statement
Replace _PyType_HasFeature() with the public PyType_HasFeature(), not with ineffective (type->tp_flags & Py_TPFLAGS_HEAPTYPE)
They are not used in PyType_GetBaseByToken().
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This chains the branches in PyType_GetBaseByToken() as well, which is effective when MSVC is in better condition on PGO.
|
I think I've finished. When checking a type without a result, this may be a bit slower than the draft PR, not trained well for now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.