Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
brandtbucher merged 4 commits intopython:mainpython/cpython:mainfrom
brandtbucher:attrsbrandtbucher/cpython:attrsCopy head branch name to clipboard
Feb 23, 2022
Merged

bpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches#31517
brandtbucher merged 4 commits intopython:mainpython/cpython:mainfrom
brandtbucher:attrsbrandtbucher/cpython:attrsCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.