home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 114732169

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
114732169 MDU6SXNzdWUxMTQ3MzIxNjk= 643 "naive" iteration is very slow 1322974 closed 0     2 2015-11-03T02:53:04Z 2019-01-15T21:09:07Z 2019-01-15T21:09:07Z CONTRIBUTOR      

``` $ ipython Python 3.5.0 (default, Sep 20 2015, 11:28:25) Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. Using matplotlib backend: Qt4Agg

In [1]: from xray import DataArray

Iteration over a Python list

In [2]: %%timeit t = list(range(10000)) for _ in t: pass ...: 10000 loops, best of 3: 87.3 µs per loop

Iteration over a ndarray

In [3]: %%timeit t = np.arange(10000) for _ in t: pass ...: 1000 loops, best of 3: 472 µs per loop

Iteration over a DataArray

In [4]: %%timeit t = DataArray(np.arange(10000)) for _ in t: pass ...: 1 loops, best of 3: 818 ms per loop ```

I'm not sure how much can be done about this as iterating over a DataArray needs to create a bunch of temporary objects (and I understand the emphasis is as usual on vectorized operations, etc.) but a >1500 fold difference certainly doesn't look good.

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

Links from other tables

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