-
-
Notifications
You must be signed in to change notification settings - Fork 30.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-45885: Add more stats for COMPARE_OP in specialize.c #31040
Conversation
Stats on some of pyperformance (before I considered float_int and int_float): https://gist.github.com/sweeneyde/157d2a24ddb7f21f2038ce1997d1b175 |
From all of pyperformance:
|
Python/specialize.c
Outdated
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_LIST); | ||
goto failure; | ||
} | ||
if (PySet_CheckExact(lhs) || PyFrozenSet_CheckExact(lhs)) { |
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.
if (PySet_CheckExact(lhs) || PyFrozenSet_CheckExact(lhs)) { | |
if (PyAnySet_CheckExact(lhs)) { |
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'd personally rather not -- IMO the ||
is more clear and self-explanatory.
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.
Thanks for this. The extra data is going to be useful.
Python/specialize.c
Outdated
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_LONG_FLOAT); | ||
goto failure; | ||
} | ||
#endif | ||
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_DIFFERENT_TYPES); |
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.
Could you rewrite this as SPECIALIZATION_FAIL(COMPARE_OP, compare_op_fail_kind(lhs, rhs));
following the pattern used in the other specialization functions?
Python/specialize.c
Outdated
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_BASEOBJECT); | ||
goto failure; | ||
} | ||
#endif |
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.
As above, could you move the classification of the failure into a helper function?
SPECIALIZATION_FAIL(COMPARE_OP, compare_op_fail_kind(lhs, rhs));
Otherwise, it obscures the logic of the specialization function.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Looks good, thanks. |
https://bugs.python.org/issue45885