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/2227#issuecomment-533036570,https://api.github.com/repos/pydata/xarray/issues/2227,533036570,MDEyOklzc3VlQ29tbWVudDUzMzAzNjU3MA==,6213168,2019-09-19T08:57:44Z,2019-09-19T08:57:44Z,MEMBER,"Can we short-circuit the special case where the index of the array used for slicing is the same object as the index being sliced, so no alignment is needed?
```python
>>> time_filter.time._variable is ds.time._variable
True
>>> %timeit xr.align(time_filter, ds.a)
477 ms ± 13.9 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```
the time spent on that align call could be zero!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,331668890
https://github.com/pydata/xarray/issues/2227#issuecomment-533033540,https://api.github.com/repos/pydata/xarray/issues/2227,533033540,MDEyOklzc3VlQ29tbWVudDUzMzAzMzU0MA==,6213168,2019-09-19T08:49:32Z,2019-09-19T08:49:32Z,MEMBER,"Before #3319:
```
%timeit ds.a.values[time_filter]
158 ms ± 1.14 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit ds.a.isel(time=time_filter.values)
2.57 s ± 3.65 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit ds.a.isel(time=time_filter)
3.12 s ± 37.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```
After #3319:
```
%timeit ds.a.values[time_filter]
158 ms ± 2.2 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit ds.a.isel(time=time_filter.values)
665 ms ± 6.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit ds.a.isel(time=time_filter)
1.15 s ± 1.55 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```
Good job!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,331668890