PERF: consolidate imports inside parse_time_string
State: closed

This PR adds an asv benchmark for the creation of `Period` objects directly from integers, and an associated speedup for the same case.

When calling `Period._from_ordinal()`, the runtime is unfortunately dominated by a pair of import statements needed to pull in the global config settings `display.date_dayfirst` and `display.date_yearfirst`. Thus, simply consolidating them leads to a significant speedup:
```
Benchmarks that have improved:

       before           after         ratio
     [08395af4]       [696b40f1]
     <parse_time_string~1>       <parse_time_string>
-         176±3ms         98.7±3ms     0.56  period.PeriodIndexConstructor.time_from_ints('D')
```

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
Hello @qwhelan! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`asv_bench/benchmarks/period.py`](https://github.com/qwhelan/pandas/blob/0f215ad4407cf409e67c8bd36aa1a650fb0505f3/asv_bench/benchmarks/period.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24084?src=pr&el=h1) Report
> Merging [#24084](https://codecov.io/gh/pandas-dev/pandas/pull/24084?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/3fe697f3c9dcb0c0a7a9b91c0098d31b39f51fef?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #24084   +/-   ##
=======================================
  Coverage   42.51%   42.51%           
=======================================
  Files         161      161           
  Lines       51689    51689           
=======================================
  Hits        21974    21974           
  Misses      29715    29715
```

| Flag | Coverage Δ | |
|---|---|---|
| #single | `42.51% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24084?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/24084?src=pr&el=footer). Last update [3fe697f...0f215ad](https://codecov.io/gh/pandas-dev/pandas/pull/24084?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24084?src=pr&el=h1) Report
> Merging [#24084](https://codecov.io/gh/pandas-dev/pandas/pull/24084?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/4b5f4d1a59a7fce09c47eb0c03ba99a6cea472c6?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #24084   +/-   ##
=======================================
  Coverage   92.21%   92.21%           
=======================================
  Files         161      161           
  Lines       51684    51684           
=======================================
  Hits        47658    47658           
  Misses       4026     4026
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.61% <ø> (ø)` | :arrow_up: |
| #single | `43% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24084?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/24084?src=pr&el=footer). Last update [4b5f4d1...3e9370d](https://codecov.io/gh/pandas-dev/pandas/pull/24084?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

can you rebase on master; I think there might be an error in the benchmark (or if not the script should complete green, the CI has been fixed).
can you remove the ``warnings`` from ``asv/benchmarks/frame_methods`` and re-push. thanks.
@jreback I believe the warnings in frame_methods were handled in another PR, so I've rebased again off master.
thanks @qwhelan