[Python-Dev] iterzip()

Guido van Rossum guido@python.org
Mon, 29 Apr 2002 08:30:55 -0400


> > Did you time any of these?
> 
> I just timed it and am shocked.  iterzip() has exactly the same code
> as zip() except for the final append result to list.  So, I expected only
> a microscopic speed-up.  I don't see where the huge performance
> improvement came from.

Probably the list-append still has a slight quadratic component --
you're doing a million elements here.

But I asked something else.  How much does the speed difference affect
the apps you have?  In my experience it's usually used for small lists
where the quadratic effect doesn't occur and the timing doesn't matter
compared to the rest of the program.

--Guido van Rossum (home page: http://www.python.org/~guido/)