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

GH-118093: Specialize `CALL_KW` by markshannon · Pull Request #123006 · python/cpython · GitHub

/ cpython Public

GH-118093: Specialize CALL_KW - #123006

Merged
markshannon merged 12 commits into
python:mainfrom
faster-cpython:specialize-call-kw
Aug 16, 2024
Merged

GH-118093: Specialize CALL_KW#123006
markshannon merged 12 commits into
python:mainfrom
faster-cpython:specialize-call-kw

Conversation

markshannon commented Aug 14, 2024
edited
Loading

Copy link
Copy Markdown
Member

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 commented Aug 15, 2024
edited
Loading

Copy link
Copy Markdown
Member Author

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

Fidget-Spinner 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

Looks good in general. Two questions.

Comment thread Lib/test/test_dis.py Outdated
Comment thread Python/bytecodes.c
Comment thread Include/internal/pycore_code.h Outdated
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
markshannon merged commit c13e7d9 into python:main Aug 16, 2024
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
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.

3 participants


Back | FazBrowse Home | New Git URL