Re: performance degradation when looping through lists

2006-04-07 Thread diffuser78
Hi, I wrote a program some days back and I was using lists heavily for performing operations such as pop, remove, append. My list size was around 1024x3 and there were around 20 different objects like this. What I want to ask you is that my program also degraded over a period of time. I cannot po

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 Alan Franzoni
Joachim Worringen on comp.lang.python said: > I use Python 2.3.4 (#1, Sep 3 2004, 12:08:45) > [GCC 2.96 2731 (Red Hat Linux 7.3 2.96-110)] on linux2 Check Peter Otten's answer, and remember as well that GCC 2.96 can lead to highly strange issues whenever used. -- Alan Franzoni <[EMAIL PRO

Re: performance degradation when looping through lists

2006-04-07 Thread Peter Otten
Joachim Worringen wrote: > 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

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 lot of memory - which can resul

Re: performance degradation when looping through lists

2006-04-07 Thread bruno at modulix
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 lot of memory - which can result in swapping . > I noticed that

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):