The `LOAD_ATTR_INSTANCE_VALUE` instruction can be sped up by storing the offset of the `valid` field in the cache.
未关闭
还没有人认领这个 Issue。
3.16
interpreter-core
performance
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 CPython 的解释器实现中的 LOAD_ATTR_INSTANCE_VALUE 指令和 _CHECK_MANAGED_OBJECT_HAS_VALUES uop 开始。检查该指令的内联缓存条目是如何定义的,以及有效性字节的偏移量当前是如何计算的。当偏移量存储在一个可用的内联缓存条目中,并且有效性检查使用该偏移量,同时相关测试和基准测试仍然通过时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- performance
- Issue 类型
- 重构
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 35/100