Re: performance degradation when looping through lists

2006-04-07 Thread Joachim Worringen
Peter Otten wrote: > Your timing code is buggy. Change it to Ooops, you're right. Everything is fine now... Thanks. Joachim -- Joachim - reply to joachim at domain ccrl-nece dot de Opinion expressed is personal and does not constitute an opinion or statement of NEC Laboratories. -- http://m

Re: performance degradation when looping through lists

2006-04-07 Thread Joachim Worringen
bruno at modulix wrote: > Joachim Worringen wrote: >> I need to process large lists (in my real application, this is to parse >> the content of a file). > > Then you probably want to use generators instead of lists. The problem > with large lists is that they eat a l

performance degradation when looping through lists

2006-04-07 Thread Joachim Worringen
I need to process large lists (in my real application, this is to parse the content of a file). I noticed that the performance to access the individual list elements degrades over runtime. This can be reproduced easily using this code: import time N=10 p=1 A=[] for i in range(N):