bpo-37537: Compute allocated blocks in _Py_GetAllocatedBlocks()#14680
Merged
Conversation
Keeping an account of allocated blocks slows down _PyObject_Malloc() and _PyObject_Free() by a measureable amount. Have _Py_GetAllocatedBlocks() iterate over the arenas to sum up the allocated blocks for pymalloc.
methane
approved these changes
Jul 10, 2019
tim-one
self-requested a review
July 10, 2019 14:52
tim-one
requested changes
Jul 10, 2019
tim-one
left a comment
Member
There was a problem hiding this comment.
Surprising! Good catch. I doubt this function is ever used outside of memory-leak detectors, so its speed is hard to care about. I'm just asking for a change to round the arena base address up to the first pool's actual address (which probably isn't really needed on Linux or Windows, but will be needed if pool sizes ever increase beyond the OS page size).
|
When you're done making the requested changes, leave the comment: |
Member
Author
|
I have made the requested changes; please review again |
tim-one
approved these changes
Jul 10, 2019
|
@nascheme: Please replace |
lisroach
pushed a commit
to lisroach/cpython
that referenced
this pull request
Sep 10, 2019
…on#14680) Keeping an account of allocated blocks slows down _PyObject_Malloc() and _PyObject_Free() by a measureable amount. Have _Py_GetAllocatedBlocks() iterate over the arenas to sum up the allocated blocks for pymalloc.
DinoV
pushed a commit
to DinoV/cpython
that referenced
this pull request
Jan 14, 2020
…on#14680) Keeping an account of allocated blocks slows down _PyObject_Malloc() and _PyObject_Free() by a measureable amount. Have _Py_GetAllocatedBlocks() iterate over the arenas to sum up the allocated blocks for pymalloc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keeping an account of allocated blocks slows down _PyObject_Malloc() and _PyObject_Free() by a measureable amount. Have _Py_GetAllocatedBlocks() iterate over the arenas to sum up the allocated blocks for pymalloc.
https://bugs.python.org/issue37537