zip() function troubles

Paul Rubin http
Fri Jul 27 03:33:03 CEST 2007

Istvan Albert <istvan.albert at> writes:
> I tested this on a linux server system with 4Gb of RAM
> a = [ 0 ] * 10**7
> takes miliseconds, but say the
> b = zip(a,a)
> will take a very long time to finish:

Do a top or vmstat while that is happening and see if you are
swapping.  You are allocating 10 million ints and 10 million tuple
nodes, = 20 million objects.  Although, even at 100 bytes per object
that would be 1GB which would fit in your machine easily.  Is it
a 64 bit cpu?  

More information about the Python-list mailing list