-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Add type-hints in tzconversion.pyx #55241
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: Add type-hints in tzconversion.pyx #55241
Conversation
Any suggestions on how to write a whatsnew note here? Perf improvement when localizing time to UTC? |
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.
wow, nice
and yeah, listing a perf improvement in whatsnew sounds good
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.
nice find
This is great. One potential future issue to be aware of though: this locks us in to having only 1D ndarrays passed to |
In that case to keep perf we'd have to resort to fused types, is that right? |
AFAIK there isn't a nice solution to the arbitrary-ndim use case. In practice it is always either 1 or 2 (maybe 0 in some corner cases) so we could make a fused type for just those. This won't be an issue anytime soon so this is just a "be aware of". im kind of hoping cython adds support for dtype-declaring ndarrays without declaring the dimension |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Part of #55179. With this, I'm seeing time plummet in the benchmark
from 159ms (Cython 0.29) and 271ms (Cython 3.0.2) to ~5-6ms on both.