python / python/cpython

Reduce overhead of pushing and popping frames in Python-to-Python calls.

Open
#93,897 0 comments 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 cost of pushing a frame for Python-to-Python calls is much lower than it used to be, but still considerably higher than it could be.

Pushing a frame should be little more than a space check and a pointer bump. Similarly popping the frame, should just be a pointer adjustment.

We want to be able to add "shim" and proxy frames for performance and debugging. To be able to do that, the cost of frame popping and pushing should be as low as possible.

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 files, tests, or concrete entry points are named. Start by locating the implementation of frame pushing and popping for Python-to-Python calls, then establish measurements for the current overhead; done means reducing those operations toward the stated space-check, pointer-bump, and pointer-adjustment goals while preserving support for shim and proxy frames.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
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.