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 521754870,MDU6SXNzdWU1MjE3NTQ4NzA=,3514,Should we cache some small properties?,5635139,open,0,,,7,2019-11-12T19:28:21Z,2019-11-16T04:32:11Z,,MEMBER,,,,"I was doing some profiling on `isel`, and see there are some properties that (I think) never change, but are called frequently. Should we cache these on their object? Pandas uses [cache_readonly](https://github.com/pandas-dev/pandas/blob/master/pandas/_libs/properties.pyx#L7) for these cases. Here's a case: we call [`LazilyOuterIndexedArray.shape`](https://github.com/pydata/xarray/blob/af28c6b02fac08494f5d9ae2718d68a084d93949/xarray/core/indexing.py#L535) frequently when doing a simple indexing operation. Each call takes ~150µs. An attribute lookup on a python object takes ~50ns (i.e. 3000x faster). IIUC the result on that property should never change. I don't think this is the solution to performance issues, and there's some additional complexity. Could they be easy & small wins, though?","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3514/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue