[Python-Dev] Frame zombies

"Martin v. Löwis" martin at v.loewis.de
Sun Jun 10 06:17:57 CEST 2007


> Should I make a patch?

-1. This could consume quite a lot of memory, and I doubt
that the speed improvement would be significant. Instead,
I would check whether performance could be improved by
just dropping the freelist. Looking at the code, I see
that it performs a realloc (!) of the frame object if
the one it found is too small. That surely must be
expensive, and should be replaced with a free/malloc pair
instead.

I'd be curious to see whether malloc on today's systems
is still so slow as to justify a free list. If it is,
I would propose to create multiple free lists per size
classes, e.g. for frames with 10, 20, 30, etc. variables,
rather than having free lists per code object.

Regards,
Martin


More information about the Python-Dev mailing list