The `LOAD_ATTR_INSTANCE_VALUE` instruction can be sped up by storing the offset of the `valid` field in the cache.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
LOAD_ATTR_INSTANCE_VALUE needs to check the validity of the objects embedded values array.
Currently, it does that by computing the offset of the valid byte.
Instead we could store the offset in the inline cache as LOAD_ATTR_INSTANCE_VALUE has several inline cache entries to spare.
The check is done in the _CHECK_MANAGED_OBJECT_HAS_VALUES uop.
Linked PRs
- gh-153122
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the LOAD_ATTR_INSTANCE_VALUE instruction and the _CHECK_MANAGED_OBJECT_HAS_VALUES uop in CPython's interpreter implementation. Review how the instruction's inline cache entries are defined and how the validity-byte offset is currently computed. Done means the offset is stored in an available inline cache entry and the validity check uses it, with the related tests and benchmarks still passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100