Skip to content

speed up library imports with laziness #1095

@apoorvalal

Description

@apoorvalal

Running

uv venv
uv pip install pyfixest tuna
uv run python3 -X importtime -c "import pyfixest" 2> imp.log
tuna imp.log

gives

Image

I almost never use did2s - why am i paying ~2.5 seconds for it on import time? This is why scikit uses lazy imports via _importlib.import_module, which we should emulate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions