Skip to content

[BUG] Importing setuptools is slow and takes nearly half a second #3441

@jiasli

Description

@jiasli

setuptools version

63.1.0

Python version

3.10.5

OS

Windows

Additional environment information

No response

Description

Importing setuptools is slow and takes nearly half a second. This imposes significant performance impact on CLI applications (Azure/azure-cli#23177).

Expected behavior

Importing setuptools should be fast.

How to Reproduce

import setuptools

Output

python -X importtime -c "import setuptools" 2>perf.log ; python -m tuna .\perf.log

image

Without setuptools, importing distutils is pretty fast:

python -X importtime -c "import distutils" 2>perf.log ; python -m tuna .\perf.log

image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions