I've implemented a free list for small long objects with a size of 1 or -1. I wanted to test how large the malloc overhead is. The result was astonishing. The free list quadrupled the speed of a simple test:
$ ./python -m timeit "for i in range(100): list(range(1000))" Without patch: 10 loops, best of 3: 79 msec per loop With patch: 10 loops, best of 3: 20.8 msec per loop Since the free list is limited to small longs, it will consume less than 1,5 MB on a 64bit OS and less than 900kb on a 32bit OS in a worst case scenario (2 * (1<<15) ~ 65k objects with a size of 14 / 22 byte each). http://bugs.python.org/issue2013 Christian _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
