[Python-Dev] int/float freelists vs pymalloc

Neal Norwitz nnorwitz at gmail.com
Fri Feb 8 07:01:49 CET 2008

On Feb 7, 2008 5:09 AM, Andrew MacIntyre <andymac at bullseye.apana.org.au> wrote:
> So I've been testing with the freelists ripped out and ints and floats
> reverted to fairly standard PyObject_New allocation (retaining the small
> int interning) and thus relying on PyMalloc to do any compaction.
> The results have been somewhat surprising...
> The short version is that:
> - for ints, the freelist is ahead of PyMalloc by a very small margin
>    (<4%)
> - for floats, the freelist is a long way behind PyMalloc (>35% slower)

Martin did some profiling of ints in py3k 1.5 years ago.  The results
of his profiling are here:

I think Martin wrote a mail to describe his work in more detail.  But
the only mails I could find are not what I remember:


I don't remember if he did any work on head or if he remembers any
more that might be relevant here.


More information about the Python-Dev mailing list