PERF: Improve Period hashing
- [x] closes #12817
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

```
# asv
-   33.75ms     3.22ms      0.10  period.period_algorithm.time_period_series_drop_duplicates
```
