-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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: optimize is_numeric_v_string_like #40501
PERF: optimize is_numeric_v_string_like #40501
Conversation
nice! two questions, neither blockers for this PR
|
Or I could update the helper function to what I used here, and then keep using it in those 3 places? |
either way i guess. i prefer to inline the check since i frequently find myself having to go look up what the is_foo_dtype's exact behavior is |
OK, I am certainly fine with inlining here |
Not directly an idea, but at least with the latest numpy release, you still get this wrong behaviour:
so even if that would change in a next release, we are still going to need to workaround it for quite a while .. |
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.
LGTM
In some of the arithmetic benchmarks (xref #39146 (comment)), just this
is_numeric_v_string_like
check takes up 15-35% of the overall time.This improves the performance of this check by using some ndarray-specialized dtype checks (checking the kind instead of the generic functions):