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

Remove the RESUME instruction #91201

Closed
markshannon opened this issue Mar 17, 2022 · 3 comments
Closed

Remove the RESUME instruction #91201

markshannon opened this issue Mar 17, 2022 · 3 comments
Assignees
Labels
performance Performance or resource usage

Comments

@markshannon
Copy link
Member

BPO 47045
Nosy @markshannon
PRs
  • bpo-47045: Remove f_state field, and make ownership of _PyInterpreterFrame explicit. #31963
  • 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-03-17.16:23:10.693>
    labels = ['performance']
    title = 'Remove the RESUME instruction'
    updated_at = <Date 2022-03-22.12:57:28.142>
    user = 'https://github.com/markshannon'

    bugs.python.org fields:

    activity = <Date 2022-03-22.12:57:28.142>
    actor = 'Mark.Shannon'
    assignee = 'Mark.Shannon'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2022-03-17.16:23:10.693>
    creator = 'Mark.Shannon'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47045
    keywords = ['patch']
    message_count = 2.0
    messages = ['415424', '415766']
    nosy_count = 1.0
    nosy_names = ['Mark.Shannon']
    pr_nums = ['31963']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue47045'
    versions = []

    @markshannon
    Copy link
    Member Author

    The RESUME instruction was added to make resumption points explicit in the bytecode. This makes it easier to implement tracing, quickening, and interrupt checks as there is an explicit place to perform these checks.

    Unfortunately, it also has considerable overhead. So we should remove it.
    To do that, we need to:

    1. Remove f_state from the InterpreterFrame so we don't need to update it.
      2 .Quicken automatically in the adaptive instructions.
    2. Check the evalbreaker when resuming a frame in the interpreter.
    3. Add some metadata to the code object, so that we know when to fire "call" events when tracing.

    @markshannon markshannon self-assigned this Mar 17, 2022
    @markshannon markshannon added the performance Performance or resource usage label Mar 17, 2022
    @markshannon markshannon self-assigned this Mar 17, 2022
    @markshannon markshannon added the performance Performance or resource usage label Mar 17, 2022
    @markshannon
    Copy link
    Member Author

    New changeset 49daf6d by Mark Shannon in branch 'main':
    bpo-47045: Remove f_state field (GH-31963)
    49daf6d

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @markshannon
    Copy link
    Member Author

    markshannon commented Jul 29, 2022

    Although we could remove the RESUME instruction, it does provide a useful point to add PEP 669 and optimizer hooks, that would be a lot messier without it. So, I'm going to leave it in (for now at least).

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant