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

Defer import of dask.array to speed up import #1795

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ericpre
Copy link
Contributor

@ericpre ericpre commented Jun 3, 2023

When various array backends of dask are installed, it can slow down significantly the import time of pint.

Running python -X importtime -c "from pint import UnitRegistry" 2> pint.txt && tuna pint.txt

Without this PR:

image

With this PR:

image

  • [n/a] Closes # (insert issue number)
  • Executed pre-commit run --all-files with no errors
  • The change is fully covered by automated unit tests
  • [n/a] Documented in docs/ as appropriate
  • Added an entry to the CHANGES file

@hgrecco
Copy link
Owner

hgrecco commented Jun 3, 2023

awesome improvement. I have a few suggestions that I will add as comments in the code

@ericpre
Copy link
Contributor Author

ericpre commented Sep 1, 2023

@hgrecco, when you have a chance, can you please add your comments to this PR? Thanks!

@ericpre
Copy link
Contributor Author

ericpre commented Jan 5, 2024

@hgrecco, would it possible to get this PR reviewed?

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 this pull request may close these issues.

2 participants