A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-February/076803.html below:

[Python-Dev] int/float freelists vs pymalloc

[Python-Dev] int/float freelists vs pymalloc [Python-Dev] int/float freelists vs pymallocChristian Heimes lists at cheimes.de
Mon Feb 11 02:48:38 CET 2008
Andrew MacIntyre wrote:
> I tried a LIFO stack implementation (though I won't claim to have done it
> well), and found it slightly slower than no freelist at all. The
> advantage of such an approach is that the known size of the stack makes
> deallocating excess objects easy (and thus no need for
> sys.compact_free_list() ).

I've tried a single linked free list myself. I used the ob_type field to
daisy chain the int and float objects. Although the code was fairly
short it was slightly slower than an attempt without a free list at all.
pymalloc is fast. It's very hard to beat it though.

A fixed size LIFO array like PyFloatObject
*free_list[PyFloat_MAXFREELIST] increased the speed slightly. IMHO a
value of about 80-200 floats and ints is realistic for most apps. More
objects in the free lists could keep too many pymalloced areas occupied.

Christian

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4