html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/3514#issuecomment-553834279,https://api.github.com/repos/pydata/xarray/issues/3514,553834279,MDEyOklzc3VlQ29tbWVudDU1MzgzNDI3OQ==,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}",,521754870 https://github.com/pydata/xarray/issues/3514#issuecomment-553832745,https://api.github.com/repos/pydata/xarray/issues/3514,553832745,MDEyOklzc3VlQ29tbWVudDU1MzgzMjc0NQ==,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}",,521754870 https://github.com/pydata/xarray/issues/3514#issuecomment-553815808,https://api.github.com/repos/pydata/xarray/issues/3514,553815808,MDEyOklzc3VlQ29tbWVudDU1MzgxNTgwOA==,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}",,521754870 https://github.com/pydata/xarray/issues/3514#issuecomment-553100094,https://api.github.com/repos/pydata/xarray/issues/3514,553100094,MDEyOklzc3VlQ29tbWVudDU1MzEwMDA5NA==,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}",,521754870