Hi Alexander and all,

First of all, sorry that I posted twice the same - google groups
reported an error when I first tried to post.

On 19 Okt., 19:58, Alexander Juarez <[email protected]> wrote:
> I think I found the collections.deque() to be faster that than the
> list.pop() which makes sense if the list is implemented as a linked
> list object. And the collections uses a array implementation.

In contrast to my first tests, it meanwhile seems to me that the
  L[0], PyList_GetSlice(L,1,PyList_GET_SIZE(L))
idiom is faster than deque in my applications. Recall that this was
the fastest replacement for pop(0), if the lists are not too long
(which will probably be the case in my applications).

After all, "collections" is Python, not Cython.

Nevertheless, I'd still appreciate to learn a Cython replacement for
pop(0) that is fast on long lists as well.

I found this:
     http://www.mail-archive.com/[email protected]/msg07518.html
but Sturla Molden's trick didn't work for me: Cython complained about
an incomplete type.

Best regards,
Simon

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to