issues: 1284475176
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1284475176 | I_kwDOAMm_X85Mj4ko | 6726 | Long import time | 34740232 | closed | 0 | 9 | 2022-06-25T07:01:18Z | 2022-10-28T16:25:41Z | 2022-10-28T16:25:41Z | NONE | What is your issue?Importing the xarray package takes a significant amount of time. For instance:
❯ time python -c "import scipy" python -c "import scipy" 0.29s user 0.23s system 297% cpu 0.175 total ❯ time python -c "import numpy" python -c "import numpy" 0.29s user 0.43s system 313% cpu 0.229 total ❯ time python -c "import datetime" python -c "import datetime" 0.05s user 0.00s system 99% cpu 0.051 total ``` I am obviously not surprised that importing xarray takes longer than importing Pandas, Numpy or the datetime module, but 1.5 s is something you clearly notice when it is done e.g. by a command-line application. I inquired about import performance and found out about a lazy module loader proposal by the Scientific Python community. AFAIK SciPy uses a similar system to populate its namespaces without import time penalty. Would it be possible for xarray to use delayed imports when relevant? |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6726/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |