PERF: better perf on min/max on indices not containing NaT for DatetimeIndex/PeriodsIndex 

closes #7633

close to what it was in 0.14.0
key was to not keep recomputing whether an index ``hasnans`` every time we need it (it is now cached).
further ``min/max`` are optimized if the index is monotonic

```
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------
timeseries_timestamp_downsample_mean         |   4.5697 |   7.8034 |   0.5856 |
dataframe_resample_min_string                |   1.8380 |   2.5294 |   0.7266 |
dataframe_resample_min_numpy                 |   1.8580 |   2.5463 |   0.7297 |
dataframe_resample_max_numpy                 |   1.8887 |   2.5803 |   0.7320 |
dataframe_resample_max_string                |   1.9130 |   2.5553 |   0.7486 |
dataframe_resample_mean_numpy                |   2.6687 |   3.3340 |   0.8004 |
dataframe_resample_mean_string               |   2.7773 |   3.3080 |   0.8396 |

Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [d2d30c7] : PERF: better perf on min/max on indices not containing NaT for DatetimeIndex/PeriodIndex
Base   [e060616] : DOC: minor corrections in v0.14.1
```