Skip to content

Optimize pdb with asyncio gating #156774

Description

@brittanyrey

Summary

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)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions