Skip to content
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

Opcode predictions for asserts, class definitions, and some calls. #82491

Closed
brandtbucher opened this issue Sep 28, 2019 · 3 comments
Closed
Assignees
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@brandtbucher
Copy link
Member

BPO 38310
Nosy @rhettinger, @brandtbucher
PRs
  • bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. #16467
  • 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/rhettinger'
    closed_at = <Date 2019-09-29.00:13:20.886>
    created_at = <Date 2019-09-28.19:15:08.492>
    labels = ['interpreter-core', '3.9', 'performance']
    title = 'Opcode predictions for asserts, class definitions, and some calls.'
    updated_at = <Date 2019-09-29.00:13:20.885>
    user = 'https://github.com/brandtbucher'

    bugs.python.org fields:

    activity = <Date 2019-09-29.00:13:20.885>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2019-09-29.00:13:20.886>
    closer = 'rhettinger'
    components = ['Interpreter Core']
    creation = <Date 2019-09-28.19:15:08.492>
    creator = 'brandtbucher'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38310
    keywords = ['patch']
    message_count = 3.0
    messages = ['353472', '353475', '353476']
    nosy_count = 2.0
    nosy_names = ['rhettinger', 'brandtbucher']
    pr_nums = ['16467']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue38310'
    versions = ['Python 3.9']

    @brandtbucher
    Copy link
    Member Author

    This patch adds four new opcode predictions:

    BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX:

    • Emitted whenever more than one map of **kwargs is unpacked into a call.
    • Pair *always* occurs together.

    LOAD_BUILD_CLASS -> LOAD_CONST:

    • Emitted whenever a class is defined *without* the use of cell vars.
    • Occurs ~93% of the time, in my analysis.

    LOAD_BUILD_CLASS -> LOAD_CLOSURE:

    • Emitted whenever a class is defined *with* the use of cell vars.
    • Occurs the other ~7% of the time

    LOAD_ASSERTION_ERROR -> RAISE_VARARGS:

    • Emitted whenever the one-argument form of "assert" is used.
    • Occurs ~91% of the time.

    @brandtbucher brandtbucher added 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Sep 28, 2019
    @rhettinger rhettinger self-assigned this Sep 28, 2019
    @rhettinger
    Copy link
    Contributor

    New changeset f185a73 by Raymond Hettinger (Brandt Bucher) in branch 'master':
    bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (GH-16467)
    f185a73

    @rhettinger
    Copy link
    Contributor

    Thanks for the patch :-)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants