-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-24700: Add a fast path for comparing array.array of equal type #3009
Conversation
Modules/arraymodule.c
Outdated
@@ -685,14 +735,17 @@ array_richcompare(PyObject *v, PyObject *w, int op) | |||
|
|||
if (k) { | |||
/* No more items to compare -- compare sizes */ | |||
equal_except_size: ; |
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.
It confused me that this can be jumped into even when sizes are equal. I would suggest renaming equal_except_size
to something else. Perhaps compare_sizes
?
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.
Looks like this change was reversed.
This lacks a NEWS entry as produced by the blurb utility. Could you add one? |
One thing: how does this fare on arrays of NaNs? Currently we have:
|
Right, didn't check to handle it. I added a test case for NaN - even if the optimization doesn't get merged, the test case would still be nice to have. I realized I also missed the |
Fair enough. Someone else can re-add a fast path for floats if they want to. |
https://bugs.python.org/issue24700