[issue1943] improved allocation of PyUnicode objects
report at bugs.python.org
Thu Jun 4 14:13:35 CEST 2009
Marc-Andre Lemburg <mal at egenix.com> added the comment:
Antoine Pitrou wrote:
> Antoine Pitrou <pitrou at free.fr> added the comment:
>> Since pymalloc is being used to manage such objects, there's
>> a lot of room for improvements, since the allocation scheme
>> is under out control. E.g. we could have pymalloc allocate
>> larger pools for PyUnicodeObjects.
> I'm not sure what "larger pools for PyUnicodeObjects" means. pymalloc
> doesn't have separate pools per object type, only per object size.
I meant larger pools for objects of sizeof(PyUnicodeObject) bytes.
The same could be done for other often used PyObjects (and only for
pymalloc is a lot faster than the OS malloc() and was designed for
Python object memory management, ie. for small blocks...
/* A fast, special-purpose memory allocator for small blocks, to be used
on top of a general-purpose malloc -- heavily based on previous art. */
/* Vladimir Marangozov -- August 2000 */
> OTOH, we could grow the size limit under which pymalloc is used,
> especially on 64-bit systems.
The limit is 256 bytes. Increasing it doesn't make much sense,
since the pools are 4k each and managed in arenas of
Anything larger than 256 bytes goes straight to the OS malloc().
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list