Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
GH-115776: Allow any fixed sized object to have inline values#123192
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
GH-115776: Allow any fixed sized object to have inline values#123192
Uh oh!
There was an error while loading.Please reload this page.
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.
Is this stuff documented anywhere?
Good point. |
Uh oh!
There was an error while loading.Please reload this page.
a4fd7aa
intopython:mainUh oh!
There was an error while loading.Please reload this page.
It looks like this PR broke a test in the mypyc transpiler:python/mypy#17973 |
Uh oh!
There was an error while loading.Please reload this page.
Currently only objects with
Py_TYPE(obj)->tp_basicsize == sizeof(PyObject)
are allowed to have inline values.This PR changes that to allow any object where all instances of the class have the same size to have inline values.
Performance is in the noise, but thestats show a clear reduction in the number of
LOAD_ATTR
s executed.Oddly, the number of
LOAD_ATTR_INSTANCE_VALUE
s executed is roughly unchanged, the new specializations being for class attributes. Fixingthe shadowing issue should improve things further and show an increase inLOAD_ATTR_INSTANCE_VALUE
s.