Memory pre-allocation for large lists
Erik Max Francis
max at alcyone.com
Wed Feb 18 02:36:52 EST 2004
More information about the Python-list mailing list
Wed Feb 18 02:36:52 EST 2004
- Previous message (by thread): Memory pre-allocation for large lists
- Next message (by thread): Memory pre-allocation for large lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Aahz wrote: > Can, yes. But why? Python uses an allocation mechanism for lists > that > results in constant amortized time; there's really no reason to > pre-allocate. If you know the size of the (large) array in advance, it's completely legitimate to preallocate the array to make the constant time factor. -- __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/ / \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE \__/ Even paranoids have real enemies. -- Delmore Schwartz
- Previous message (by thread): Memory pre-allocation for large lists
- Next message (by thread): Memory pre-allocation for large lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list