-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage
Description
Currently a plain Python object has the following fields:
- values
- (managed) __dict__
- GC 1
- GC 2
- refcount
- __class__
- __weakrefs__
- WASTED
The WASTED
field is present because, due to alignment, we must allocate a multiple of 2 words.
We can reduce this to 6 by merging the values and __dict__ pointers into one (only one can be valid at any time),
and then moving the __weakrefs__ field into the empty space.
- __weakrefs__
- values or __dict__
- GC 1
- GC 2
- refcount
- __class__
See faster-cpython/ideas#125 for full discussion
Linked PRs
tiran, Fidget-Spinner, erlend-aasland and corona10
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage