-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-94841: Ensure arena_map_get() is inlined in PyObject_Free() #94842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Did you observe an improvement in performance?
3.11b3+ PGO (2022-07-09 7b5737a)
Faster PyObject_Free() with v143
Slower PyObject_Free() with v143
|
To backport to 3.10, we can just use
Another, more dramatic, option would be to disable the obmalloc radix tree on WIndows. E.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will merge
Thanks @neonene for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…ythonGH-94842) (cherry picked from commit 9b3f779) Co-authored-by: neonene <[email protected]>
GH-94862 is a backport of this pull request to the 3.11 branch. |
I don’t care much about the 3.10 backport, but feel free to do more research! It looks like the compiler matters more than the processor here. |
) (cherry picked from commit 9b3f779) Co-authored-by: neonene <[email protected]>
@nascheme Do you want to look more into your fixes, either the 3.10-specific way to force inlining or disabling the radix tree on Windows? |
…Free() (pythonGH-94842) Co-authored-by: Neil Schemenauer <[email protected]> (cherry picked from commit d0850aa170580b494beda030a94fb04254e4acbc) Co-authored-by: neonene <[email protected]>
I made an attempt at backporting (GH-94868), not sure I did it right though. Using |
…GH-94842) Need to define ALWAYS_INLINE macro for 3.10. Co-authored-by: neonene <[email protected]>
NOTE: This patch cannot be beckported to 3.10, in which
Py_ALWAYS_INLINE
macro is not introduced.