Message202849
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. |
|
Date |
User |
Action |
Args |
2013-11-14 15:26:38 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner |
2013-11-14 15:26:38 | serhiy.storchaka | set | messageid: <1384442798.77.0.691253218065.issue19581@psf.upfronthosting.co.za> |
2013-11-14 15:26:38 | serhiy.storchaka | link | issue19581 messages |
2013-11-14 15:26:38 | serhiy.storchaka | create | |
|