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

Place dict (and values) pointers at a fixed (negative) offset from the base of the object. #90105

Closed
markshannon opened this issue Dec 1, 2021 · 2 comments
Assignees
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@markshannon
Copy link
Member

BPO 45947
Nosy @markshannon, @Fidget-Spinner
PRs
  • bpo-45947: Place dict and values pointer at fixed (negative) offset just before GC header. #29879
  • 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 = <Date 2022-01-20.11:51:02.049>
    created_at = <Date 2021-12-01.13:30:48.955>
    labels = ['interpreter-core', '3.11', 'performance']
    title = 'Place dict (and values) pointers at a fixed (negative) offset from the base of the object.'
    updated_at = <Date 2022-01-20.11:51:02.049>
    user = 'https://github.com/markshannon'

    bugs.python.org fields:

    activity = <Date 2022-01-20.11:51:02.049>
    actor = 'Mark.Shannon'
    assignee = 'Mark.Shannon'
    closed = True
    closed_date = <Date 2022-01-20.11:51:02.049>
    closer = 'Mark.Shannon'
    components = ['Interpreter Core']
    creation = <Date 2021-12-01.13:30:48.955>
    creator = 'Mark.Shannon'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45947
    keywords = ['patch']
    message_count = 2.0
    messages = ['407457', '407946']
    nosy_count = 2.0
    nosy_names = ['Mark.Shannon', 'kj']
    pr_nums = ['29879']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue45947'
    versions = ['Python 3.11']

    @markshannon
    Copy link
    Member Author

    To get to the dict (or values array) of an object, we currently need 3 dependent loads.
    By placing the dict at a fixed offset, this can be reduced to one.

    What was obj[obj->type->dictoffset] becomes obj[FIXED_OFFSET]

    See faster-cpython/ideas#80, specifically
    faster-cpython/ideas#80 (comment) for more details.

    @markshannon markshannon added the 3.11 only security fixes label Dec 1, 2021
    @markshannon markshannon self-assigned this Dec 1, 2021
    @markshannon markshannon added 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Dec 1, 2021
    @markshannon
    Copy link
    Member Author

    New changeset 8319114 by Mark Shannon in branch 'main':
    bpo-45947: Place dict and values pointer at fixed (negative) offset just before GC header. (GH-29879)
    8319114

    @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.11 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

    1 participant