python / python/cpython

Avoid excessive stack usage in all cases.

Open
#94,445 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
Avg merge
1d 9h
Merged PRs (30d)
558

Description

In 3.11 we asserted that we didn't use too much stack, but that failed https://github.com/python/cpython/issues/94329

If we can guarantee that no code object uses more than a certain number of slots, N, where N should be in the order of a 100, we can potentially simplify and speed up bounds and recursion checking by combining them.

It also means we can use fixed size chunks for the frame stack, as we know that no frame can be larger than a chunk.

  • PR: gh-99237
  • PR: gh-99262

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

No source file or test is named. Review PRs gh-99237 and gh-99262 first, then trace the Python 3.11 code-object and frame-stack checks described in the issue. Done means guaranteeing a bounded number of slots per code object and validating the resulting bounds and recursion-checking behavior.

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.