-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: avoid is_bool_indexer check where possible #31399
PERF: avoid is_bool_indexer check where possible #31399
Conversation
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.
Can you show some timings?
else: | ||
except (KeyError, ValueError): | ||
if isinstance(key, tuple) and isinstance(self.index, MultiIndex): | ||
# kludge |
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.
Such a comment is not really helpful if you don't explain the kludge ..
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.
agreed, but this comment is present in the status quo
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.
does this make any difference or just moving code around?
This should not change any behavior.
I like doing it in two lines inside try/excepts so i can see in coverage measurements whether the call is ever successful |
can you rebase; i am not sure if @jorisvandenbossche had more comments. |
Just my question from above: Can you show some timings? |
It's pretty small (especially since is_scalar and is_iterator were recently optimized)
|
And with a scalar indexer? |
for the scalar case I expect the difference to be zero, or even slower by the amount of a
|
That's what I expected as well. (in general, if you do changes specifically for performance, it's helpful for reviewing that you show some relevant timings) |
@jorisvandenbossche pls make sure labels and versions on the issue and PR are good before merging |
xref #30349, not a lot of ground to pick up here, but we can avoid a few calls