[Python-Dev] int/float freelists vs pymalloc
"Martin v. Löwis"
martin at v.loewis.de
Sat Feb 9 16:51:25 CET 2008
> Well, yes, it doesn't run out of memory, but if pymalloc needs
> to allocate lots of objects of the same size, then performance
> degrades due to the management overhead involved for checking
> the free pools as well as creating new arenas as needed.
> To reduce this overhead, it may be a good idea to preallocate
> pools for common sizes and make sure they don't drop under a
> certain threshold.
I still can't see why this could speed up anything. The total
time will be the same - whether you allocate them in advance
or on demand should make no difference.
In any case, if you think that you can improve things, please
submit a patch.
More information about the Python-Dev