[Patches] [ python-Patches-687598 ] array.append is sloooow

SourceForge.net noreply@sourceforge.net
Sun, 23 Feb 2003 06:16:42 -0800


Patches item #687598, was opened at 2003-02-16 14:55
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=687598&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
>Priority: 7
Submitted By: logistix (logistix)
Assigned to: Nobody/Anonymous (nobody)
Summary: array.append is sloooow

Initial Comment:
array.append re'mallocs and copies each time an item is 
appended to it.  That makes the code below grind to a 
halt.  I stole the resizing algorithm from listobject.c and 
it speeds things up a bit.

Python 2.3a1 (#38, Feb 16 2003, 14:23:39) [MSC v.1300 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import array
>>> a = array.array('i')
>>> for i in range(10000000):
...     a.append(i)
...


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2003-02-23 09:16

Message:
Logged In: YES 
user_id=6380

Good idea. Somebody please check the patch and then check it in.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=687598&group_id=5470