> 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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to