GH-115775: Use `__static_attributes__` to initialize shared keys by markshannon · Pull Request #118468 · python/cpython
The stats are not obviously better.
This PR reduces misses in LOAD_ATTR specializations, but it also increases the number of deferred operations due to shadowing.
Both STORE_ATTR_WITH_HINT and LOAD_ATTR_WITH_HINT are reduced in number considerably, being replaced by STORE_ATTR_INSTANCE_VALUE and LOAD_ATTR_INSTANCE_VALUE.
From this, it appears that this PR does what it aims to do. It also appears that it would be worth improving our handling of shadowed attributes.
I plan to fix the shadowing issue before merging this, so that it becomes a clear improvement