import pdb costs ~84 ms. The largest single contributor is asyncio at ~36 ms — imported for exactly one call site.
Only import asyncio in pdb, if asyncio is actually being used by the program being debugged.
NOTE: initially this issue also included lazy imports optimizations, until @hugovk let me know that there was already a PR open to address that.
(PR is prepared)
pythongh-156774: Point pdb lazy-import NEWS entry at the filed issue
pythongh-156774: Scope pdb change down to the asyncio import only
gh-156774: Speed up pdb startup with asyncio guard (#156775)
Merge branch 'main' into tachyon-native-callable
pythongh-156774: Speed up pdb startup with asyncio guard (python#156775)
Activity
pythongh-156774: Point pdb lazy-import NEWS entry at the filed issue
pythongh-156774: Scope pdb change down to the asyncio import only
gh-156774: Speed up pdb startup with asyncio guard (#156775)
Merge branch 'main' into tachyon-native-callable
pythongh-156774: Speed up pdb startup with asyncio guard (python#156775)
pythongh-156774: Speed up pdb startup with asyncio guard (python#156775)