This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Place dict (and values) pointers at a fixed (negative) offset from the base of the object.
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, kj
Priority: normal Keywords: patch

Created on 2021-12-01 13:30 by Mark.Shannon, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29879 merged Mark.Shannon, 2021-12-01 14:04
Messages (2)
msg407457 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-12-01 13:30
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 https://github.com/faster-cpython/ideas/issues/80, specifically
https://github.com/faster-cpython/ideas/issues/80#issuecomment-931504847 for more details.
msg407946 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-12-07 16:03
New changeset 8319114feedd2a5b77378bba24eb9fb2689c5033 by Mark Shannon in branch 'main':
bpo-45947: Place dict and values pointer at fixed (negative) offset just before GC header. (GH-29879)
https://github.com/python/cpython/commit/8319114feedd2a5b77378bba24eb9fb2689c5033
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90105
2022-01-20 11:51:02Mark.Shannonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-12-07 16:03:03Mark.Shannonsetmessages: + msg407946
2021-12-04 17:31:40kjsetnosy: + kj
2021-12-01 14:04:55Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28104
2021-12-01 13:30:48Mark.Shannoncreate