Reduce the size of plain Python objects from 8 to 6 machine words. #95245
Labels
pending
The issue will be closed if no feedback is provided
performance
Performance or resource usage
markshannon commentedJul 25, 2022
Currently a plain Python object has the following fields:
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.
See faster-cpython/ideas#125 for full discussion
The text was updated successfully, but these errors were encountered: