PERF: 3x speedup in Series of dicts with datetime keys by not having error message scale with input
State: closed

Surprisingly, the majority of the time spent in constructing a `Series` from a dict with `datetime`-like keys is spent formatting the keys into strings for an error message that gets suppressed.

As there's a test ensuring the string case makes it into the error message, we preserve the behavior there. In non-string cases, we mirror how the other `Dtypes` handle this case and do not include the input.
```
$ asv compare v0.24.0rc1 HEAD -s
       before           after         ratio
     [fdc4db25]       [5c82eab5]
     <v0.24.0rc1^0>       <series_dict_speedup>
-      1.14±0.02s          303±4ms     0.27  series_methods.SeriesConstructor.time_constructor('dict') 
```

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Datetime
description: Datetime data dtype
name: Performance
description: Memory or execution speed performance
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24743?src=pr&el=h1) Report
> Merging [#24743](https://codecov.io/gh/pandas-dev/pandas/pull/24743?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/33f91d8f9f2e84f2b5f3ac3f0481b691c977c427?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #24743      +/-   ##
==========================================
+ Coverage   92.38%   92.38%   +<.01%     
==========================================
  Files         166      166              
  Lines       52358    52360       +2     
==========================================
+ Hits        48373    48375       +2     
  Misses       3985     3985
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.81% <100%> (ø)` | :arrow_up: |
| #single | `42.91% <81.81%> (-0.16%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24743?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/dtypes/dtypes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24743/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2R0eXBlcy5weQ==) | `95.6% <100%> (+0.02%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24743?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/24743?src=pr&el=footer). Last update [33f91d8...5c82eab](https://codecov.io/gh/pandas-dev/pandas/pull/24743?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/24743?src=pr&el=h1) Report
> Merging [#24743](https://codecov.io/gh/pandas-dev/pandas/pull/24743?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/33f91d8f9f2e84f2b5f3ac3f0481b691c977c427?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #24743      +/-   ##
==========================================
+ Coverage   92.38%   92.38%   +<.01%     
==========================================
  Files         166      166              
  Lines       52358    52360       +2     
==========================================
+ Hits        48373    48375       +2     
  Misses       3985     3985
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.81% <100%> (ø)` | :arrow_up: |
| #single | `42.91% <81.81%> (-0.16%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24743?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/dtypes/dtypes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24743/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2R0eXBlcy5weQ==) | `95.6% <100%> (+0.02%)` | :arrow_up: |

------

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

Hello @qwhelan! Thanks for updating the PR.





Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on January 13, 2019 at 00:56 Hours UTC
@jreback Done - original already had a test.
thanks @qwhelan