[pypy-issue] [issue1093] PyPy list element del insert to slow

raymin tracker at bugs.pypy.org
Tue Mar 20 07:34:31 CET 2012


New submission from raymin <guo.raymin at gmail.com>:

# testList.py
L = []

i = 0
while i < 100000:
    L.append('k%d' % i)
    i += 1

i = 0
while i < 100000:
    if i & 1:
        k = L[0]
        del L[0]
        L.insert(i, k)
    else:
        k = L[i]
        del L[i]
        L.append(k)
    i += 1

print i, len(L)

time python testList.py   : 0m6.710s
time pypy testList.py     : 0m41.702s

----------
messages: 4114
nosy: pypy-issue, raymin
priority: wish
status: unread
title: PyPy list element del insert to slow

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1093>
________________________________________


More information about the pypy-issue mailing list