Move Tier 2 interpreter out of `_PyEval_EvalFrameDefault`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
See discussion starting here: https://github.com/faster-cpython/ideas/issues/631#issuecomment-1995191531
Basically, we see no real perf improvement for having the two switches inside the same function, and we have some indication that on Windows the compiler is failing to optimize this giant function. In addition, the logic for each of the interpreters is somewhat complicated due to sharing variables and labels.
This is not as simple as reverting gh-111428 (issue gh-111520), but in the abstract, that's the proposal.
The priority isn't clear, but it's probably doing before the 3.13 feature freeze.
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 linked faster-cpython discussion, then inspect _PyEval_EvalFrameDefault and the surrounding Tier 2 interpreter logic. Determine how the two interpreters currently share variables and labels and what boundaries are needed to separate them. Done means the Tier 2 interpreter is moved out while preserving interpreter behavior and addressing the stated optimization concern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100