inducer / inducer/pudb

Support for `sys.monitoring` backend?

Open
#683 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.2k
Forks
245
Avg merge
13m
Merged PRs (30d)
5

Description

**Is your feature request related to a problem? Please describe.**
Python 3.12 added a new namespace [sys.monitoring](https://docs.python.org/3/library/sys.monitoring.html) ([PEP669](https://peps.python.org/pep-0669/)) that allows tracing Python code with lower overhead than previous methods. Numbers I have seen range between a 10x to 100x speed up of code running in between break points. It would be great if pudb could make use of this.

**Describe the solution you'd like**
Recently, in Python 3.14 (still in alpha), the Bdb class was [updated](https://github.com/python/cpython/pull/124533) to support a `backend='monitoring'` option. Pudb mostly relies on `Bdb` (I think), so perhaps it could add a preference for making use of this new backend starting with Python 3.14.

**Describe alternatives you've considered**
None

**Additional context**
I haven't looked closely at Pudb's interface to Bdb. A quick search shows one call to `sys.settrace`. That might work around the Bdb interface which supports `sys.settrace` and `sys.monitoring` backends and need to be modified for the `sys.monitoring` case. Also, there could be other things in the Pudb code that make it impractical to use the monitoring backend. I haven't looked into this thoroughly enough so far. For now, I wanted to raise awareness about the potential performance improvement.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing pudb's Bdb integration and the reported sys.settrace call; compare them with Python 3.14's Bdb backend='monitoring' support and the sys.monitoring API described in PEP 669. Determine the scope of adding a monitoring preference and whether existing debugger behavior remains supported across Python versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.