Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73504

Re: Are there performance concerns with popping from front of long lists vs. the end of long lists?

Date 2014-06-22 11:18 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: Are there performance concerns with popping from front of long lists vs. the end of long lists?
References <1403460221.20360.131626817.5EFAE11B@webmail.messagingengine.com>
Newsgroups comp.lang.python
Message-ID <mailman.11193.1403462492.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 06/22/2014 11:03 AM, python@bdurham.com wrote:
>
> Should I have any performance concerns with the index position used
> to pop() values off of large lists? In other words, should pop(0) and
>  pop() be time equivalent operations with long lists?

I believe lists are optimized for adding and removing items from the end, so anywhere else will have an impact.  You'll 
have to do measurements to see if the impact is worth worrying about in your code.

--
~Ethan~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Are there performance concerns with popping from front of long lists vs. the end of long lists? Ethan Furman <ethan@stoneleaf.us> - 2014-06-22 11:18 -0700

csiph-web