Where'd my memory go? (was Re: [Python-Dev] Dictionary sparseness)

Tim Peters tim.one@comcast.net
Mon, 05 May 2003 17:00:16 -0400


[Skip Montanaro]

[on assorted freelists]
> These shortcomings could be remedied by suitable inspection
> functions added to sys for debug builds.

If someone cares enough <wink>, sure.

> This leads me to wonder, has anyone measured the cost of deleting the
> int and float free lists when pymalloc is enabled?  I wonder how
> unbearable it would be.

Vladimir did when he was first developing pymalloc, and left the free lists
in deliberately.  I haven't tried it.  pymalloc is a bit faster since then,
but will always have the additional overhead of needing to figure out
*which* freelist to look in (pymalloc's free lists are segregated by block
size), and, because it recycles empty pools among different block sizes too,
the overhead on free of checking for pool emptiness.  The int free list is
faster in part because it's so damn Narcissistic <0.7 wink>.