home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "MEMBER", issue = 521754870 and user = 6213168 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, updated_at (date)

user 1

  • crusaderky · 4 ✖

issue 1

  • Should we cache some small properties? · 4 ✖

author_association 1

  • MEMBER · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
553834279 https://github.com/pydata/xarray/issues/3514#issuecomment-553834279 https://api.github.com/repos/pydata/xarray/issues/3514 MDEyOklzc3VlQ29tbWVudDU1MzgzNDI3OQ== crusaderky 6213168 2019-11-14T10:52:13Z 2019-11-14T10:52:13Z MEMBER

python %%prun -s cumulative for _ in range(10000): ds.isel(x=[0]) Output (uncached): ncalls tottime percall cumtime percall filename:lineno(function) 10000 0.148 0.000 3.317 0.000 dataset.py:1854(isel) [...] 60000 0.092 0.000 0.122 0.000 indexing.py:535(shape)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Should we cache some small properties? 521754870
553832745 https://github.com/pydata/xarray/issues/3514#issuecomment-553832745 https://api.github.com/repos/pydata/xarray/issues/3514 MDEyOklzc3VlQ29tbWVudDU1MzgzMjc0NQ== crusaderky 6213168 2019-11-14T10:47:43Z 2019-11-14T10:47:43Z MEMBER

I prefer pandas.utils.cache_readonly to the Python 3.8 cachedproperty. Besides not needing a dict, it is also written in cython, which should make a substantial difference.

max-sixty could you post your benchmark where you measure 150us? I tried caching that property with @cache_readonly and I only get a boost of 7us.

```python import xarray ds = xarray.Dataset({'d': ('x', [1, 2]), 'x': [10, 20]}) ds ds.to_netcdf("foo.nc") ds.close() ds = xarray.open_dataset("foo.nc")

%timeit ds.isel(x=[0]) ` With@property: 187us With@cache_readonly``: 180us

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Should we cache some small properties? 521754870
553815808 https://github.com/pydata/xarray/issues/3514#issuecomment-553815808 https://api.github.com/repos/pydata/xarray/issues/3514 MDEyOklzc3VlQ29tbWVudDU1MzgxNTgwOA== crusaderky 6213168 2019-11-14T10:02:57Z 2019-11-14T10:02:57Z MEMBER

@max-sixty afraid so. But as I said it should be straightforward to use a variant that instead of self.__dict__[self.name] uses getattr/setattr.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Should we cache some small properties? 521754870
553100094 https://github.com/pydata/xarray/issues/3514#issuecomment-553100094 https://api.github.com/repos/pydata/xarray/issues/3514 MDEyOklzc3VlQ29tbWVudDU1MzEwMDA5NA== crusaderky 6213168 2019-11-12T20:28:45Z 2019-11-12T20:28:45Z MEMBER

By reading the implementation of cachedproperty, it needs a __dict__. It should be straightforward to write a variant that uses slots though.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Should we cache some small properties? 521754870

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 6560.216ms · About: xarray-datasette