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

Improve efficiency of PRECALL/CALL instructions · Issue #90690 · python/cpython · GitHub

Repository navigation

Improve efficiency of PRECALL/CALL instructions #90690

Closed

Description

BPO 46532
Nosy @markshannon
PRs
  • bpo-46532: Reduce number of memory writes to update call_shape.kwnames. #31231
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/markshannon'
    closed_at = None
    created_at = <Date 2022-01-26.09:44:42.979>
    labels = []
    title = 'Improve efficiency of PRECALL/CALL instructions'
    updated_at = <Date 2022-02-10.12:57:59.448>
    user = 'https://github.com/markshannon'

    bugs.python.org fields:

    activity = <Date 2022-02-10.12:57:59.448>
    actor = 'Mark.Shannon'
    assignee = 'Mark.Shannon'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2022-01-26.09:44:42.979>
    creator = 'Mark.Shannon'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46532
    keywords = ['patch']
    message_count = 3.0
    messages = ['411721', '411723', '412996']
    nosy_count = 1.0
    nosy_names = ['Mark.Shannon']
    pr_nums = ['31231']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46532'
    versions = []

    Linked PRs

    Activity

    1. markshannon commented on Jan 26, 2022

      MemberAuthor

      The PRECALL/CALL bytecode pair for calls is new (still in review at time of writing) and is not as efficient as it could be.

      Some possible improvements are:

      Transfer refcount of func when making a frame.

      NULL call_shape.kwnames after use instead of in PRECALL, as many specialized instructions already assert that it is NULL.

      Specialize the PRECALL instructions. Either for simple cases like type(arg) so we can skip the CALL, or for complex cases like PythonClass(args) where PRECALL can create object, and set up the frame so that CALL calls the init function.

    2. markshannon commented on Jan 26, 2022

      MemberAuthor

      Possibly consider replacing the specializations for str(arg) and tuple(arg) with a more general bytecode that can be used for other objects as well.

    3. changed the title [-]Improve effeciency of PRECALL/CALL instructions[/-] [+]Improve efficiency of PRECALL/CALL instructions[/+] on Feb 9, 2022
    4. changed the title [-]Improve effeciency of PRECALL/CALL instructions[/-] [+]Improve efficiency of PRECALL/CALL instructions[/+] on Feb 9, 2022
    5. markshannon commented on Feb 10, 2022

      MemberAuthor

      New changeset 2cea8c2 by Mark Shannon in branch 'main':
      bpo-46532: Reduce number of memory writes to update call_shape.kwnames. (GH-31231)
      2cea8c2

    6. transferred this issue fromon Apr 10, 2022
    7. markshannon commented on May 18, 2022

      MemberAuthor

      As described here we can remove the PRECALL instruction entirely, shortening the call sequence for many calls.

    8. added a commit that references this issue on May 19, 2022
    9. added a commit that references this issue on Sep 6, 2023
    10. added a commit that references this issue on Sep 6, 2023
    11. added a commit that references this issue on Sep 8, 2023
    12. added a commit that references this issue on Mar 24, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    performancePerformance or resource usagetype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL