Skip to content
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

bpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches #31517

Merged
merged 4 commits into from
Feb 23, 2022

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Feb 23, 2022

One adaptive entry is enough.

https://bugs.python.org/issue44337

@sweeneyde
Copy link
Member

LGTM. Can't the same idea shrink LOAD_METHOD from 3 entries down to 2? Then _PyAttrCache can be eliminated altogether.

@markshannon
Copy link
Member

Can't the same idea shrink LOAD_METHOD from 3 entries down to 2? Then _PyAttrCache can be eliminated altogether.

I was looking at LOAD_METHOD yesterday, and it needs 3 slots of data for Python methods. It needs the type version, the shared dict-keys's version and a pointer to the Python function, in addition to the count and original oparg. We could try using 16 bits for one of the versions, saving a slot at the cost of more specialization failures.

@markshannon
Copy link
Member

markshannon commented Feb 23, 2022

Looks good.
Can you rename dk_version_or_hint to dk_version as we no longer use it as a hint.
Feel free to merge once you've done that.

@brandtbucher brandtbucher merged commit 281ea9c into python:main Feb 23, 2022
@brandtbucher brandtbucher deleted the attrs branch July 21, 2022 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants