Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing ctapipe.io is taking very long (>5s) #2476

Closed
GernotMaier opened this issue Nov 29, 2023 · 2 comments
Closed

Importing ctapipe.io is taking very long (>5s) #2476

GernotMaier opened this issue Nov 29, 2023 · 2 comments

Comments

@GernotMaier
Copy link
Contributor

We are noticing while working on SimPipe that imports on ctapipe.io increases startup times of applications by typically 5 seconds.

This is confirmed by:

python -X importtime -c "import ctapipe.io"
...
import time:       445 |    6439288 | ctapipe.io

These are us, so importing takes 6.4s. This is probably related to unnecessary cross-import

@maxnoe
Copy link
Member

maxnoe commented Nov 29, 2023

This is very much related to #1037

E.g. SimTelEventSource needs to create R1 from R0 using e.g. the GainSelector from ctapipe.calib.
Importing from ctapipe.calib triggers import ctapipe.image due to the above-mentioned issue.

Looking at what takes long, I noticed image.extractors and image.muon.intensityfitter and a missing caching of numba compilation, which removed 1s in local testing, fix in #2477.

@maxnoe
Copy link
Member

maxnoe commented Jan 4, 2024

I am closing this, since the easy fixes have been made and the rest will be dealt with by imlpementing a fix for #1037

@maxnoe maxnoe closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants