Skip to content

Support for sys.monitoring backend? #683

Description

@wshanks

Is your feature request related to a problem? Please describe.
Python 3.12 added a new namespace sys.monitoring (PEP669) 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 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions