--- On Mon, 1/25/10, Steve Howell <[email protected]> wrote: > From: Steve Howell <[email protected]> > Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time > To: "Michael Foord" <[email protected]>, "Nick Coghlan" > <[email protected]> > Cc: "Christian Heimes" <[email protected]>, [email protected] > Date: Monday, January 25, 2010, 8:33 PM > I made enough of a patch to at least > get a preliminary benchmark. > > The program toward the bottom of this email runs over 100 > times faster with my patch. The patch still has a ways > to go--I use a very primitive scheme to reclaim orphan > pointers (1000 at a time) and I am still segfaulting when > removing the last element of the list. But the initial > results at least confirm that the intended benefit is > achievable. >
Ok, I fixed the obvious segfaults, and I am now able to pass all the tests on my debug build. A new diff is attached. There is still at least one bug in my code in listextend, which the tests do not seem to expose, so I will try to at least beef up the test suite a bit. I really like listobject.c. Very clean code, very easy to understand. I guess I shouldn't be surprised.
DIFF
Description: Binary data
_______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
