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

Applications are painfully slow to even start. #681

Closed
GernotMaier opened this issue Nov 16, 2023 · 3 comments · Fixed by #682
Closed

Applications are painfully slow to even start. #681

GernotMaier opened this issue Nov 16, 2023 · 3 comments · Fixed by #682

Comments

@GernotMaier
Copy link
Contributor

This is really starting to get an issue, as it slows down developing, testing, everything.

Running e.g.,

 python simtools/applications/validate_file_using_schema.py --help

Take >3 sec for me. This should just print help.

Running

python -X importtime simtools/applications/validate_file_using_schema.py --help

shows that it us due to extensive importing (see attachment).

In this example, it is e.g., not clear why ctapipe is imported.

import.txt

@GernotMaier
Copy link
Contributor Author

GernotMaier commented Nov 16, 2023

This looks like that this is almost exclusively due to ctapipe.

I suggest to remove anything related to ctapipe from simtools.utils.general and move it into a separate module. The general module is used a lot, but not very often for the hdf5 functionality.

@VictorBarbosaMartins - is it fine for you if I move this out of general.py?

@GernotMaier
Copy link
Contributor Author

PR #682 addresses most of this issue.

When we discuss the cleanup of general.py, we should address the remaining issues (e.g., moving the coordinate transformations somewhere else will remove the dependency on astropy.coordinates.errors (1/3 of import time). Rest is due to astropy.units, which is something we need.

@VictorBarbosaMartins
Copy link
Contributor

This looks like that this is almost exclusively due to ctapipe.

I suggest to remove anything related to ctapipe from simtools.utils.general and move it into a separate module. The general module is used a lot, but not very often for the hdf5 functionality.

@VictorBarbosaMartins - is it fine for you if I move this out of general.py?

Hi Gernot. That is probably a good idea, Im fine with it

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

Successfully merging a pull request may close this issue.

2 participants