GC performance with lists

Zentrader zentraders at gmail.com
Tue Sep 4 15:11:43 EDT 2007


On Sep 4, 9:27 am, "John Krukoff" <jkruk... at ltgc.com> wrote:
> > -----Original Message-----
> > From: python-list-bounces+jkrukoff=ltgc.... at python.org [mailto:python-
> > list-bounces+jkrukoff=ltgc.... at python.org] On Behalf Of jo... at mit.edu
> > Sent: Tuesday, September 04, 2007 8:07 AM
> > To: python-l... at python.org
> > Subject: GC performance with lists
>
> > While working on some python wrapping, I've run into some problems
> > where the GC seems to take an unreasonable amount of time to run. The
> > code below is a demonstration:
>
> > import gc
> > #gc.disable()
>
> > data = []
> > for i in xrange(100000):
>
> >     shortdata = []
> >     for j in range(57):
> >         mytuple = (j, i+1, i+2, i+3, i+4, i+5, i+6)
> >         shortdata.append(mytuple)
> >     data.extend(shortdata)
>
> > print len(data)

Isn't this the type of program that psyco is supposed to do well
with?  Perhaps someone else knows a little bit more.




More information about the Python-list mailing list