-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: cache plotting date locators for DatetimeIndex plotting #58992
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
Conversation
@@ -826,6 +828,7 @@ def _monthly_finder(vmin, vmax, freq: BaseOffset) -> np.ndarray: | |||
return info | |||
|
|||
|
|||
@functools.cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No chance of getting non-hashable inputs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think vmax/vmin are always floats. I'll type these so we have some validation
Nice! |
Thanks @mroeschke |
…DatetimeIndex plotting
A slightly late comment: doing the caching this way means multiple axes may share the same result. I have not chased through but I am not 100% sure that the returned object is not mutable (so you are opening up a bunch of spooky action-at-a-distance bugs). It may be be better to do the caching on a per-converter basis. I am a bit curious why mpl is calling |
…s for DatetimeIndex plotting) (#59002) Backport PR #58992: PERF: cache plotting date locators for DatetimeIndex plotting Co-authored-by: Matthew Roeschke <[email protected]>
Using the last plotting example from the issue