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
LOAD_ATTR cache does not fully replicate PyObject_GetAttr behavior #86432
Comments
The problem is that the descriptor-ness of a type-level attribute is only checked at opcache-set time, not at opcache-hit time. $ python3.8 test.py
2
$ ./python --version
Python 3.10.0a2+
$ git rev-parse --short HEAD
789359f47c
$ ./python test.py
1 |
Good catch, Kevin! Would you like to submit a PR for fixing this? |
Given that having attributes that are classes is quite uncommon, I think we can not optimize of the attribute itself is a class instead of checking for descriptors on every hit, hurting the performance gains |
Yury, any preference here? |
We could also store the tag of the type object if is a descriptor and compare against that on the cache hit to check that our assumptions are valid. The price here would be an extra pointer on the cache per opcode that may not even be used most of the time. |
s/the attribute itself is a class/the attribute itself is in the class/ |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: