Skip to content

GH-118093: Specialize CALL_KW #123006

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

Merged
merged 12 commits into from
Aug 16, 2024
Merged

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Aug 14, 2024

According to our stats the CALL_KW opcode is one of the most common opcodes that prevents projection of tier 2 traces.
Making CALL_KW suitable for tier 2 is infeasible, but we can specialize it in tier 1 such that the specializations can be handled by tier 2.

This PR adds three specializations:

  • CALL_KW_PY for calls to Python functions
  • CALL_KW_BOUND_METHODS for calls to bound methods
  • CALL_KW_NON_PY for calls to everything else.

@markshannon
Copy link
Member Author

markshannon commented Aug 15, 2024

No impact on performance
Stats show 99.9% specialization with a low (<1%) miss rate.

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

Looks good in general. Two questions.

@markshannon markshannon merged commit c13e7d9 into python:main Aug 16, 2024
57 checks passed
@markshannon markshannon deleted the specialize-call-kw branch August 16, 2024 16:12
jeremyhylton pushed a commit to jeremyhylton/cpython that referenced this pull request Aug 19, 2024
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
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.

3 participants