PERF: Implement RangeIndex min/max using RangeIndex properties
State: closed

- [X] closes #17607
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry

Benchmarks are essentially the same as what's referenced in the issue.  Maybe a few ns slower since I combined logic into a helper function vs having identical code (other than `elif`) for both min/max, which was the case I did the benchmarks posted in the issue.  Updated benchmarks:

```
      before           after         ratio
     [fedf9228]       [4cb0de8d]
-        25.4±0ms      1.77±0.06μs     0.00  index_object.Range.time_min
-      26.0±0.9ms      1.71±0.06μs     0.00  index_object.Range.time_max
-        25.4±0ms         1.51±0μs     0.00  index_object.Range.time_max_trivial
-        25.4±0ms         1.30±0μs     0.00  index_object.Range.time_min_trivial

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
```

Labels:
name: Performance
description: Memory or execution speed performance

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=h1) Report
> Merging [#17611](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/8276a420a36c26eaab38856177023cb064963f19?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/17611/graphs/tree.svg?token=eZ4WkYLtcO&width=650&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #17611      +/-   ##
==========================================
- Coverage    91.2%   91.18%   -0.02%     
==========================================
  Files         163      163              
  Lines       49637    49648      +11     
==========================================
+ Hits        45269    45271       +2     
- Misses       4368     4377       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.97% <100%> (ø)` | :arrow_up: |
| #single | `40.18% <27.27%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/range.py](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9yYW5nZS5weQ==) | `92.83% <100%> (+0.24%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.77% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=footer). Last update [8276a42...5379fc2](https://codecov.io/gh/pandas-dev/pandas/pull/17611?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

I'm wondering it something similar, but more general, couldn't be done that works with both indices and series using ``is_monotonic_*``. 

E.g.:

```python
def max(self):
    if self.is_monotonic_increasing:
        return self[-1]
    elif self.is_monotonic_decreasing:
        return self[0]
    else:
        return nanops.nanmax(self.values)
```

Seems to me this should work. What do you think, have I missed something nonobvious?
@topper-123 : I think that will work in general, but I wonder if there are cases where the additional overhead of computing `is_monotonic_*` could outweigh performance gains.  Would be interesting to look into.
thanks @jschendel