[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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

bpo-37537: Compute allocated blocks in _Py_GetAllocatedBlocks() #14680

Merged
merged 3 commits into from Jul 10, 2019

Conversation

Copy link
Member

nascheme commented Jul 10, 2019

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

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.
Copy link
Member

tim-one left a 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).

Objects/obmalloc.c Outdated Show resolved Hide resolved
Objects/obmalloc.c Outdated Show resolved Hide resolved
Copy link

bedevere-bot commented Jul 10, 2019

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

Copy link
Member Author

nascheme commented Jul 10, 2019

I have made the requested changes; please review again

Copy link

bedevere-bot commented Jul 10, 2019

Thanks for making the requested changes!

@methane, @tim-one: please review the changes made to this pull request.

nascheme merged commit 5d25f2b into python:master Jul 10, 2019
Copy link

bedevere-bot commented Jul 10, 2019

@nascheme: Please replace # with GH- in the commit message next time. Thanks!

nascheme deleted the obmalloc_no_allocated branch Jul 10, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants