summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-02-14 18:34:46 +0000
committerRaymond Hettinger <python@rcn.com>2004-02-14 18:34:46 +0000
commit129e66b68dfc0517f22d504edfb5010aec35d5cb (patch)
treefcaad49960d4a0ec2e36da0abfdfba0712584d7f /Doc
parent3522dfbd98800166407ca1d33a39a937dcf8d0bf (diff)
downloadcpython-129e66b68dfc0517f22d504edfb5010aec35d5cb.tar.gz
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 'Doc')
-rw-r--r--Doc/whatsnew/whatsnew24.tex4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/whatsnew/whatsnew24.tex b/Doc/whatsnew/whatsnew24.tex
index 1fbc298be7..4720eeab99 100644
--- a/Doc/whatsnew/whatsnew24.tex
+++ b/Doc/whatsnew/whatsnew24.tex
@@ -260,8 +260,8 @@ yellow 5
\begin{itemize}
\item The machinery for growing and shrinking lists was optimized
- for speed and for space efficiency. Small lists (under six elements)
- never over-allocate by more than one element. Large lists do not
+ for speed and for space efficiency. Small lists (under eight elements)
+ never over-allocate by more than three elements. Large lists do not
over-allocate by more than 1/8th. Appending and popping from lists
now runs faster due to more efficient code paths and less frequent
use of the underlying system realloc(). List comprehensions also