--- On Wed, 1/27/10, Antoine Pitrou <solip...@pitrou.net> wrote: > From: Antoine Pitrou <solip...@pitrou.net> > Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time > To: python-dev@python.org > Date: Wednesday, January 27, 2010, 12:41 PM > Le mercredi 27 janvier 2010 à 11:49 > -0800, Steve Howell a écrit : > > A slightly more sane alternative would be to leave > ob_size and ob_item > > alone with their current semantics, and then replace > allocated with > > self->excess, where > > > > self->excess == excess_above * 256 > + excess_below. > > Or we could use allocated's sign bit in order to store the > flag (of > whether there is an orphaned area or not) and then store > the orphaned > pointer as ob_items[-1]. Thus we don't have to limit the > magnitude of > anything. And since allocated itself isn't used in any > really critical > path, it doesn't slow down anything. >
Ok, I will try that technique and benchmark it, as it would address one strong objection to the proposal. I think I've summarized most of the other major objections here: http://wiki.python.org/moin/ProposalToSpeedUpListOperations _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com