Python 3.12's new monitoring and debugging API
summary
Python 3.12 exposes PEP 669 low‑impact monitoring that registers callbacks in the mon namespace, enables events per function and per thread, and patches bytecode at load time so debuggers avoid instrumenting every function. Benchmarks show the old sys.settrace path runs 3–5× slower while the new monitoring path adds about 20% overhead in the basic case. Demonstrations include a tiny debugger prototype (six lines plus frame inspection), works with VS Code/PyCharm adapters, and pdb has not switched yet.
AI-written summary · about
chapters (8)
- 0:00Debugging and Python's history
- 5:53Traditional debugging limits
- 9:02Debugging tools evolution
- 14:42Python 3.12 monitoring API
- 21:01Debugger with new API
- 23:12New API performance impact
- 25:19Monitoring API adoption
- 26:23Q&A on bytecode & eBPF
related talks
28mWhat makes a Python debugger possible and how can we make it 100x faster
23mThe Hitchhiker's Guide to Advanced Python Monitoring
32mA new safe external debugger interface for CPython
19mThe Journey of Upgrading A Python Version: From a Debugger Perspective
29mHow we are making CPython faster. Past, present and future.
24mLet’s Rethink Debugging
23mTrace functions: Building a tiny debugger
50mHow I built a power debugger out of the standard library and things I found on the internet
