python / python/cpython

Optimise the way tracemalloc and PyRefTracer hooks work

Open
#125,790 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interpreter-core performance type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

In https://github.com/python/cpython/issues/125703 @markshannon has raised that he is unhappy about the performance implications of where these hooks are placed and in a call we discussed that he has some ideas on how to make them more performant by moving them elsewhere or adapting then.

I am opening this issue to track and sync about these improvements for 3.14 and beyond.

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 or tests are named. Start by reading issue 125703 and the linked discussion about tracemalloc and PyRefTracer hook placement, then inspect the relevant CPython runtime code and performance measurements. Done is not defined here; the issue needs an agreed approach and measurable 3.14 performance target before implementation can begin.

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.