Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73503 > unrolled thread
| Started by | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| First post | 2014-06-22 14:33 -0400 |
| Last post | 2014-06-22 14:33 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Are there performance concerns with popping from front of long lists vs. the end of long lists? Terry Reedy <tjreedy@udel.edu> - 2014-06-22 14:33 -0400
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2014-06-22 14:33 -0400 |
| Subject | Re: Are there performance concerns with popping from front of long lists vs. the end of long lists? |
| Message-ID | <mailman.11192.1403462020.18130.python-list@python.org> |
On 6/22/2014 2:03 PM, python@bdurham.com wrote: > Should I have any performance concerns with the index position used to > pop() values off of large lists? Yes. While performance is generally not part of the language specification, in CPython seq.pop(i) is O(len(seq)-i) > In other words, should pop(0) and pop() be time equivalent operations > with long lists? No. If you want this, use collections.deque. -- Terry Jan Reedy
Back to top | Article view | comp.lang.python
csiph-web