bpo-45885: Add more stats for COMPARE_OP in specialize.c#31040
bpo-45885: Add more stats for COMPARE_OP in specialize.c#31040markshannon merged 4 commits intopython:mainfrom
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.
| if (PySet_CheckExact(lhs) || PyFrozenSet_CheckExact(lhs)) { | |
| if (PyAnySet_CheckExact(lhs)) { |
There was a problem hiding this comment.
I'd personally rather not -- IMO the || is more clear and self-explanatory.
markshannon
left a comment
There was a problem hiding this comment.
Thanks for this. The extra data is going to be useful.
Python/specialize.c
Outdated
| goto failure; | ||
| } | ||
| #endif | ||
| SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_DIFFERENT_TYPES); |
There was a problem hiding this comment.
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.
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