-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Period plotting performance #24308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PERF: Period plotting performance #24308
Conversation
Setup ```python In [3]: N = 2000 ...: M = 5 ...: idx = date_range('1/1/1975', periods=N) ...: df = DataFrame(np.random.randn(N, M), index=idx) ``` Master: ```python In [3]: %time df.plot() CPU times: user 274 ms, sys: 66.7 ms, total: 340 ms Wall time: 377 ms Out[3]: <matplotlib.axes._subplots.AxesSubplot at 0x11eda6128> ``` HEAD: ```python In [4]: %time df.plot() CPU times: user 141 ms, sys: 32.6 ms, total: 173 ms Wall time: 194 ms Out[4]: <matplotlib.axes._subplots.AxesSubplot at 0x11550a5f8> ```
Hello @TomAugspurger! Thanks for submitting the PR.
|
The slowdown was operating element wise on an ndarray of Period objects. The array was coming from matplotlib. I'm not sure if we always got the ndarray of Period objects and previously handled them differently, or if something changed on MPL's end to convert what we're giving them (PeriodIndex) to an ndarray. |
Codecov Report
@@ Coverage Diff @@
## master #24308 +/- ##
==========================================
+ Coverage 92.28% 92.28% +<.01%
==========================================
Files 162 162
Lines 51827 51829 +2
==========================================
+ Hits 47827 47829 +2
Misses 4000 4000
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24308 +/- ##
==========================================
+ Coverage 92.28% 92.28% +<.01%
==========================================
Files 162 162
Lines 51827 51831 +4
==========================================
+ Hits 47827 47833 +6
+ Misses 4000 3998 -2
Continue to review full report at Codecov.
|
lgtm. |
* PERF: Period plotting performance Setup ```python In [3]: N = 2000 ...: M = 5 ...: idx = date_range('1/1/1975', periods=N) ...: df = DataFrame(np.random.randn(N, M), index=idx) ``` Master: ```python In [3]: %time df.plot() CPU times: user 274 ms, sys: 66.7 ms, total: 340 ms Wall time: 377 ms Out[3]: <matplotlib.axes._subplots.AxesSubplot at 0x11eda6128> ``` HEAD: ```python In [4]: %time df.plot() CPU times: user 141 ms, sys: 32.6 ms, total: 173 ms Wall time: 194 ms Out[4]: <matplotlib.axes._subplots.AxesSubplot at 0x11550a5f8> ```
* PERF: Period plotting performance Setup ```python In [3]: N = 2000 ...: M = 5 ...: idx = date_range('1/1/1975', periods=N) ...: df = DataFrame(np.random.randn(N, M), index=idx) ``` Master: ```python In [3]: %time df.plot() CPU times: user 274 ms, sys: 66.7 ms, total: 340 ms Wall time: 377 ms Out[3]: <matplotlib.axes._subplots.AxesSubplot at 0x11eda6128> ``` HEAD: ```python In [4]: %time df.plot() CPU times: user 141 ms, sys: 32.6 ms, total: 173 ms Wall time: 194 ms Out[4]: <matplotlib.axes._subplots.AxesSubplot at 0x11550a5f8> ```
Setup
0.23.4:
HEAD:
Closes #24304