Skip to content

gh-94673: Add Per-Interpreter tp_weaklist for Static Builtin Types #95302

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

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Jul 26, 2022

@ericsnowcurrently ericsnowcurrently merged commit 3e7cad3 into python:main Jul 29, 2022
@ericsnowcurrently ericsnowcurrently deleted the shareable-static-types-tp_weaklist branch July 29, 2022 01:23
@markshannon
Copy link
Member

@ericsnowcurrently
Have you benchmarked this?

I expect that it won't make any difference, but I'm a bit concerned as _PyObject_GET_WEAKREFS_LISTPTR is on the "fast" path of normal object de-allocation. I put "fast" in quotes because it is far from fast, but I don't want to make it any slower.

It seems to me, that the extra check is not needed during de-allocation.

@ericsnowcurrently
Copy link
Member Author

Good point. I'll take a look Monday.

@ericsnowcurrently
Copy link
Member Author

Pyperformance shows 1.01x slower, so I'll need to address that.

ericsnowcurrently added a commit that referenced this pull request Aug 4, 2022
gh-95302 seems to have introduced a small performance regression. Here we make some minor changes to recover that lost performance.
iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Aug 11, 2022
pythongh-95302 seems to have introduced a small performance regression. Here we make some minor changes to recover that lost performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants