cache DateOffset attrs now that they are immutable #21582
TL;DR ~6x speedup in
Alright! Now that DateOffset objects are immutable (#21341), we can can start caching stuff. This was pretty much the original motivation that brought me here, so I'm pretty psyched to finally make this happen.
The motivating super-slow operation is
Total Runtime Before: 32.708 seconds
pstats output (truncated) before:
pstats output (truncated) after:
There is some more tweaking around the edges we can do for perf, but this is the big one. (Also another big one when columns can have PeriodDtype).
@@ Coverage Diff @@ ## master #21582 +/- ## ========================================== - Coverage 91.9% 91.9% -0.01% ========================================== Files 153 153 Lines 49549 49547 -2 ========================================== - Hits 45539 45537 -2 Misses 4010 4010