PERF: period factorization
Merged in #14419

---
- [x] closes #14338
- [x] tests not needed / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

asv 

```
   before     after       ratio
  [c41c6511] [96b364a4]
-     2.44s    46.28ms      0.02  groupby.groupby_period.time_groupby_sum
```

cc @sinhrks , @bmoscon

## [Current coverage](https://codecov.io/gh/pydata/pandas/pull/14348?src=pr) is 85.26% (diff: 100%)

> Merging [#14348](https://codecov.io/gh/pydata/pandas/pull/14348?src=pr) into [master](https://codecov.io/gh/pydata/pandas/branch/master?src=pr) will decrease coverage by **<.01%**

``` diff
@@             master     #14348   diff @@
==========================================
  Files           140        140          
  Lines         50634      50634          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43173      43172     -1   
- Misses         7461       7462     +1   
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [d98e982...a77ccc2](https://codecov.io/gh/pydata/pandas/compare/d98e982ecb0f6b7f3478a63caac34e0be238895c...a77ccc21df5316a630d138d4a5afe62e3e1491f6?src=pr)
 thanks for taking care of this. It looks like this  is targeted for 0.19.1; any rough idea when that will be released? 
 Looks good to me. We only should include a whatsnew notice, depending on the outcome of https://github.com/pydata/pandas/issues/14352 (adding a whatsnew file to put it in in https://github.com/pydata/pandas/pull/14366)
 Looks good to me! @jreback 
 @chris-b1 whoops, sorry, closed this and I don't see a reopen button ..
 Strange, I can't reopen either, will just make a new PR
 #14419
 Possibly some glitches due to the repo transfer. Older PRs are also stuck on "Checking for ability to merge automatically…" (that was the reason I wanted to close/reopen this one to retrigger it)
