python / python/cpython

The inline cache for `LOAD_ATTR` is too large.

Open
#93,533 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.12 interpreter-core performance
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

The inline cache for LOAD_METHOD takes 10 code units, which is considerably larger than other inline caches, and is an obstacle to merging LOAD_ATTR and LOAD_METHOD (https://github.com/python/cpython/pull/93430), as LOAD_ATTR is such a common instruction.

See https://github.com/faster-cpython/ideas/discussions/396 for some ideas on how to shrink the inline cache.

Linked PRs
  • gh-103014

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the LOAD_ATTR and LOAD_METHOD inline-cache discussion in faster-cpython/ideas#396, then review the linked work in gh-103014. The goal is to shrink the LOAD_METHOD cache and remove the obstacle to merging LOAD_ATTR and LOAD_METHOD.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.