PERF: improve resample perf
Related to #7633. It gets better than the result attached #7633, but still slower more than 1.2 times compared to 1.4.0

Modified:
- Avoid every time module `import` in `Index.max/min` 
- Avoid duplicated `max` call from `resample/_get_time_bins` and `_get_range_edges`.
- Optimize `lib/generate_bins_dt64` and `tslib/period_asfreq_arr`.

Remaining bottlenecks are `NaT` masking performed in `lib/generate_bins_dt64` and `tslib/period_asfreq_arr`. Is there any better way to do that?

```
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------
dataframe_resample_mean_numpy                |   4.9963 |   3.7940 |   1.3169 |
dataframe_resample_mean_string               |   5.0424 |   3.8280 |   1.3172 |
dataframe_resample_max_numpy                 |   4.1796 |   3.0069 |   1.3900 |
dataframe_resample_min_numpy                 |   4.2127 |   2.9987 |   1.4049 |
dataframe_resample_min_string                |   4.1687 |   2.9490 |   1.4136 |
dataframe_resample_max_string                |   4.3443 |   2.9283 |   1.4835 |
timeseries_timestamp_downsample_mean         |  16.1959 |   8.6366 |   1.8753 |
timeseries_period_downsample_mean            |  47.6096 |  19.7030 |   2.4164 |
-------------------------------------------------------------------------------


Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [54fb875] : PERF: Improve index.min and max perf
Base   [da0f7ae] : RLS: 0.14.0 final
```
