home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1088419434

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
1088419434 PR_kwDOAMm_X84wQ-nD 6107 is_dask_collection: micro optimization 10194086 closed 0     1 2021-12-24T15:04:42Z 2022-01-26T08:41:28Z 2021-12-29T16:27:55Z MEMBER   0 pydata/xarray/pulls/6107

In #6096 I realized that DuckArrayModule("dask") is called a lot in our tests - 145'835 times. Most of those are from is_dask_collection (is_duck_dask_array) This change avoids that the instance needs to be built every time.

```python import xarray as xr

%timeit xr.core.pycompat.DuckArrayModule("dask").available %timeit xr.core.pycompat.dsk.available ```

18.9 µs ± 97.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) 77.1 ns ± 1.22 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)

Which leads to an incredible speed up of our tests of about 2.7 s :grin: ((18.9 - 0.0771) * 145835 / 1e6).

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6107/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.575ms · About: xarray-datasette