FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-45885: Add more stats for COMPARE_OP in specialize.c by sweeneyde · Pull Request #31040 · python/cpython · GitHub

/ cpython Public

bpo-45885: Add more stats for COMPARE_OP in specialize.c - #31040

Merged
markshannon merged 4 commits into
python:mainfrom
sweeneyde:more_compare_op_stats
Feb 3, 2022
Merged

bpo-45885: Add more stats for COMPARE_OP in specialize.c#31040
markshannon merged 4 commits into
python:mainfrom
sweeneyde:more_compare_op_stats

Conversation

sweeneyde commented Feb 1, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

Stats on some of pyperformance (before I considered float_int and int_float): https://gist.github.com/sweeneyde/157d2a24ddb7f21f2038ce1997d1b175

sweeneyde commented Feb 1, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

From all of pyperformance:

COMPARE_OP_INT_JUMP:   454436174 1.9% 58.9%
COMPARE_OP:             59845807 0.2% 95.2%
COMPARE_OP_ADAPTIVE:    48912937 0.2% 96.1%
COMPARE_OP_STR_JUMP:    20343452 0.1% 98.1%
COMPARE_OP_FLOAT_JUMP:  18384022 0.1% 98.4%

COMPARE_OP:
 unquickened:    59845807 10.0%
    deferred:    47982034 8.0%
       deopt:        5709 0.0%
         hit:   492833412 82.0%
        miss:      330236 0.1%
  success:      110039
  failure:      820864
    kind  0:    50088 6.1%
    kind 12:    56388 6.9%
    kind 13:       45 0.0%
    kind 14:    60430 7.4%
    kind 15:    35732 4.4%
    kind 16:    18354 2.2%
    kind 17:    40646 5.0%
    kind 18:     8579 1.0%
    kind 19:   227608 27.7%  (Note: mostly frozenset <= frozenset in bm_meteor_contest)
    kind 20:    45127 5.5%
    kind 21:    13893 1.7%
    kind 22:   262472 32.0%  (Note: mostly scimark_lu and scimark_fft doing float compared to int)
    kind 23:     1502 0.2%

Comment thread Python/specialize.c Outdated
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_LIST);
goto failure;
}
if (PySet_CheckExact(lhs) || PyFrozenSet_CheckExact(lhs)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
if (PySet_CheckExact(lhs) || PyFrozenSet_CheckExact(lhs)) {
if (PyAnySet_CheckExact(lhs)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd personally rather not -- IMO the || is more clear and self-explanatory.

sweeneyde requested a review from markshannon February 1, 2022 17:28

markshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for this. The extra data is going to be useful.

Comment thread Python/specialize.c Outdated
goto failure;
}
#endif
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_DIFFERENT_TYPES);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could you rewrite this as SPECIALIZATION_FAIL(COMPARE_OP, compare_op_fail_kind(lhs, rhs)); following the pattern used in the other specialization functions?

Comment thread Python/specialize.c Outdated
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_BASEOBJECT);
goto failure;
}
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Comment thread Python/specialize.c Outdated

Copy link
Copy Markdown
Member

Looks good, thanks.

markshannon merged commit 674ab66 into python:main Feb 3, 2022
sweeneyde deleted the more_compare_op_stats branch February 3, 2022 18:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL