Skip to content

Improve module import time #137

@rpadmanabhan

Description

@rpadmanabhan

Is your feature request related to a problem? Please describe.
It takes almost 4 seconds for muon to import, it would be nice if we could import muon < 1s like scanpy

Python 3.9.12 (main, Apr  5 2022, 06:56:58) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import timeit
>>> import_time = timeit.timeit("import muon", number=1)
>>> print("Time taken to import muon:", import_time, "seconds")
Time taken to import muon: 4.092318220064044 seconds

Describe the solution you'd like
I have not dug into the code too much, maybe delaying any costly setups/internal imports to later when needed so most users can avoid the initial delay.

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions