[issue19581] PyUnicodeWriter: change the overallocation factor for Windows
Serhiy Storchaka
report at bugs.python.org
Thu Nov 14 16:26:38 CET 2013
Serhiy Storchaka added the comment:
Many collections in other programming languages use overallocating rate 100%. Perhaps overallocating rate 12.5% for Python lists is good compromise between speed and memory usage (as far as Python lists have no explicit resize method), but for short-living objects we can use larger overallocating rate.
In theory for overallocating rate r long list needs in average O(1/log(1+r)) reallocations and O((r+1)/r) copyings per element. I.e. 50% overallocating rate is 3-3.4 times more efficient than current 12.5% overallocating rate and 100% overallocating rate is 1.5-1.7 times more efficient than 50% overallocating rate (in terms of numbers of reallocations and copyings).
I'm interesting what will happened when increase overallocating rate (50% or 100%) for PyAccu.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19581>
_______________________________________
More information about the Python-bugs-list
mailing list