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
Add padding in list allocation #92914
Labels
3.10
3.11
3.12
performance
Performance or resource usage
type-bug
An unexpected behavior, bug, or error
Comments
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
May 18, 2022
serhiy-storchaka
added a commit
that referenced
this issue
May 19, 2022
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 19, 2022
…ber (pythonGH-92915) (cherry picked from commit 8a6af5a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 19, 2022
…ber (pythonGH-92915) (cherry picked from commit 8a6af5a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
ambv
pushed a commit
that referenced
this issue
Jun 7, 2022
miss-islington
added a commit
that referenced
this issue
Jun 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.10
3.11
3.12
performance
Performance or resource usage
type-bug
An unexpected behavior, bug, or error
serhiy-storchaka commentedMay 18, 2022
Since the Python memory allocator has granularity of 16 bytes, allocating 24 bytes does not save memory in comparison with allocating 32 bytes. One of changes in #82554 was to round the allocated size for list up to 4 items (16 bytes on 32-bit platform and 32 bytes of 64-bit platform). #87740 reverted this. Therefore, if you create an empty list, then extend it with 1 item two times, you will need two allocations, even if the first allocation has a space for yet one item (but list does not know about this).
The text was updated successfully, but these errors were encountered: