diff options
author | Raymond Hettinger <python@rcn.com> | 2004-02-14 18:34:46 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-02-14 18:34:46 (GMT) |
commit | ab517d2eacba7fec5f31dd25b8e43dca678cda53 (patch) | |
tree | 9c5c5930186f315128c6979e9159426b2825f7b2 /Misc | |
parent | 2731ae4d6dbf887c698ba7e62590a4f27df62bb9 (diff) | |
download | cpython-ab517d2eacba7fec5f31dd25b8e43dca678cda53.zip cpython-ab517d2eacba7fec5f31dd25b8e43dca678cda53.tar.gz cpython-ab517d2eacba7fec5f31dd25b8e43dca678cda53.tar.bz2 |
Fine tune the speed/space trade-off for overallocating small lists.
The Py2.3 approach overallocated small lists by up to 8 elements.
The last checkin would limited this to one but slowed down (by 20 to 30%)
the creation of small lists between 3 to 8 elements.
This tune-up balances the two, limiting overallocation to 3 elements
(significantly reducing space consumption from Py2.3) and running faster
than the previous checkin.
The first part of the growth pattern (0, 4, 8, 16) neatly meshes with
allocators that trigger data movement only when crossing a power of two
boundary. Also, then even numbers mesh well with common data alignments.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -19,8 +19,8 @@ Core and builtins - Changed the internal list over-allocation scheme. For larger lists, overallocation ranged between 3% and 25%. Now, it is a constant 12%. - For smaller lists (n<=5), overallocation was upto eight bytes. Now, - the overallocation is no more than one byte -- this improves space + For smaller lists (n<8), overallocation was upto eight elements. Now, + the overallocation is no more than three elements -- this improves space utilization for applications that have large numbers of small lists. - Support for arbitrary objects supporting the read-only buffer |