-
Notifications
You must be signed in to change notification settings - Fork 317
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
qcodes import takes a long time #4543
Comments
@eendebakpt Which version of qcodes have you tested. I spend a fair amount of time improving this before 0.32 for example. For example the imports of opencensus azure are lazy and has been so since 0.32. See 9f90a67 |
@jenshnielsen With qcodes updated to master the import of azure is indeed lazy. There is still room for improvement though. Running:
results in a > 1 second import time of qcodes on my system. Some more candidates to reduce the import time:
Can be removed, or made lazy (for example with a mechanism like sympy/sympy#23832). Tests should not impact runtime import performances.
https://github.com/QCoDeS/Qcodes/blob/master/qcodes/parameters/array_parameter.py#L10
https://github.com/QCoDeS/Qcodes/blob/master/qcodes/dataset/__init__.py#L27 (this triggers also imports of xarray and scipy, maybe they would have been imported anyway)
|
4616: Reducing qcodes import times r=jenshnielsen a=edumur Hi all, Following this discussion #4565 and this issue #4543 I am proposing this pull request to work on reducing qcodes loading time. I have started with pandas. I tried to propagate what `@jenshnielsen` did to make pandas import lazy-import. I am not sure I have succeeded since I still see pandas being imported while doing `importtime-waterfall`. I would gladly improve the request if someone help me on this. If this becomes a successful endeavor, I will continue by making other import lazy-import. Co-authored-by: Etienne Dumur <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jens H. Nielsen <[email protected]>
Closing as the import time was improved in two pr's |
Importing qcodes with
import qcodes
takes a long time (> 2 seconds on the system tested). The import time can be analysed with tools like https://github.com/asottile/importtime-waterfallSeveral components could perhaps not be loaded by default, or with a lazy loader (e.g. https://scientific-python.org/specs/spec-0001/, but there are more tools)
An example is the import
from opencensus.ext.azure.log_exporter import AzureLogHandler
fromqcodes.logger.logger
. By defaultqc.config.telemetry.enabled
is False, so the import is executed at startup, but not used.(more examples can be found by analysing the output of importtime-waterfall)
The text was updated successfully, but these errors were encountered: