X Tutup
The Wayback Machine - https://web.archive.org/web/20220416145457/https://github.com/python/cpython/issues/91276
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

Make all jump opcodes relative #91276

Open
iritkatriel opened this issue Mar 25, 2022 · 5 comments
Open

Make all jump opcodes relative #91276

iritkatriel opened this issue Mar 25, 2022 · 5 comments
Assignees
Labels
3.11 interpreter-core performance

Comments

@iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Mar 25, 2022

BPO 47120
Nosy @markshannon, @corona10, @brandtbucher, @iritkatriel
PRs
  • #32115
  • #32215
  • #32221
  • #32353
  • #32359
  • #32400
  • 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/iritkatriel'
    closed_at = None
    created_at = <Date 2022-03-25.14:30:53.931>
    labels = ['interpreter-core', '3.11', 'performance']
    title = 'Make all jump opcodes relative'
    updated_at = <Date 2022-04-07.14:59:34.889>
    user = 'https://github.com/iritkatriel'

    bugs.python.org fields:

    activity = <Date 2022-04-07.14:59:34.889>
    actor = 'iritkatriel'
    assignee = 'iritkatriel'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2022-03-25.14:30:53.931>
    creator = 'iritkatriel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47120
    keywords = ['patch']
    message_count = 4.0
    messages = ['416003', '416431', '416466', '416772']
    nosy_count = 4.0
    nosy_names = ['Mark.Shannon', 'corona10', 'brandtbucher', 'iritkatriel']
    pr_nums = ['32115', '32215', '32221', '32353', '32359', '32400']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue47120'
    versions = ['Python 3.11']

    @iritkatriel
    Copy link
    Member Author

    @iritkatriel iritkatriel commented Mar 25, 2022

    For some of our jump opcodes target is absolute, so it can easily require EXTENDED_ARGS. Our analysis [1] shows that turning all absolute jumps into relative jumps will eliminate almost all EXTENDED_ARGS on jumps.

    This will require a _BACK version for each jump type, which negates the oparg.

    [1] faster-cpython/ideas#235 (reply in thread)

    @iritkatriel iritkatriel self-assigned this Mar 25, 2022
    @iritkatriel iritkatriel added interpreter-core performance 3.11 labels Mar 25, 2022
    @iritkatriel iritkatriel self-assigned this Mar 25, 2022
    @iritkatriel iritkatriel added interpreter-core performance labels Mar 25, 2022
    @iritkatriel iritkatriel changed the title Make all jumps relative Make all jump opcodes relative Mar 25, 2022
    @iritkatriel iritkatriel changed the title Make all jumps relative Make all jump opcodes relative Mar 25, 2022
    @markshannon
    Copy link
    Member

    @markshannon markshannon commented Mar 31, 2022

    New changeset a00518d by Irit Katriel in branch 'main':
    bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD (GH-32115)
    a00518d

    @brandtbucher
    Copy link
    Member

    @brandtbucher brandtbucher commented Mar 31, 2022

    Another benefit of this work is that we'll be able to remove first_instr from the eval loop.

    @iritkatriel
    Copy link
    Member Author

    @iritkatriel iritkatriel commented Apr 5, 2022

    New changeset 0aa8d5c by Irit Katriel in branch 'main':
    bpo-47120: make JUMP_NO_INTERRUPT relative (GH-32221)
    0aa8d5c

    @iritkatriel
    Copy link
    Member Author

    @iritkatriel iritkatriel commented Apr 15, 2022

    This is complete.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 interpreter-core performance
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants
    X Tutup