[Patches] [ python-Patches-687598 ] array.append is sloooow
SourceForge.net
noreply@sourceforge.net
Sun, 16 Feb 2003 11:55:03 -0800
Patches item #687598, was opened at 2003-02-16 13: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: 5
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)
...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=687598&group_id=5470