Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19774
| From | Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Iterate from 2nd element of a huge list |
| Date | 2012-02-02 07:23 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <jgddkn$58n$1@speranza.aioe.org> (permalink) |
| References | <jgabs9$btl$1@speranza.aioe.org> <mailman.5284.1328072129.27778.python-list@python.org> |
Em 01-02-2012 04:55, Cameron Simpson escreveu: > On 01Feb2012 03:34, Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> wrote: > | BTW, iter seems faster than iterating thru mylist[1:]! > > I would hope the difference can be attributed to the cost of copying > mylist[1:]. I don't think so. I tried several times and the differences were almost always consistent. I put mylist1=mylist[1:] outside the time control. iter still seems a little bit faster. Running both programs several times (10000000 elements list) I only got iter being slower once! But, of course, most of the difference comes from the copy.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Iterate from 2nd element of a huge list Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> - 2012-02-01 01:39 +0000
Re: Iterate from 2nd element of a huge list Cameron Simpson <cs@zip.com.au> - 2012-02-01 13:02 +1100
Re: Iterate from 2nd element of a huge list duncan smith <buzzard@urubu.freeserve.co.uk> - 2012-02-01 02:31 +0000
Re: Iterate from 2nd element of a huge list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-01 02:43 +0000
Re: Iterate from 2nd element of a huge list Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> - 2012-02-01 03:16 +0000
Re: Iterate from 2nd element of a huge list Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> - 2012-02-01 03:34 +0000
Re: Iterate from 2nd element of a huge list Cameron Simpson <cs@zip.com.au> - 2012-02-01 15:55 +1100
Re: Iterate from 2nd element of a huge list Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> - 2012-02-02 07:23 +0000
Re: Iterate from 2nd element of a huge list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-02 07:38 +0000
Re: Iterate from 2nd element of a huge list Arnaud Delobelle <arnodel@gmail.com> - 2012-02-01 07:09 +0000
Re: Iterate from 2nd element of a huge list Peter Otten <__peter__@web.de> - 2012-02-01 09:11 +0100
Re: Iterate from 2nd element of a huge list Arnaud Delobelle <arnodel@gmail.com> - 2012-02-01 10:54 +0000
Re: Iterate from 2nd element of a huge list Paul Rubin <no.email@nospam.invalid> - 2012-02-01 01:25 -0800
Re: Iterate from 2nd element of a huge list Stefan Behnel <stefan_ml@behnel.de> - 2012-02-01 12:28 +0100
csiph-web