[Python-Dev] iterzip()

Tim Peters tim.one@comcast.net
Mon, 29 Apr 2002 19:51:27 -0400


[Jeremy]
> The "0," tuples aren't deallocated until the end of the function, so
> it seems good to get them out of the current generation.

They move out of gen0 and gen1 regularly and quickly; it's the gen2
collections that consume the time.

> ...
> Here's some data from gprof to be puzzled by.  I ran Tim's test with
> only run(storetups) enabled.  Here's the top of the output:

I think you also cut the size of the test by about a factor of 10, else you
would have seen many more calls to PyObject_Malloc.

> Each sample counts as 0.01 seconds.
>   %   cumulative   self              self     total
>  time   seconds   seconds    calls  ms/call  ms/call  name
>  60.19      0.62     0.62   112233     0.01     0.01  PyObject_Malloc

> ..
> So the profile output suggests that it's spending 60% of its time in
> pymalloc.

Quite possible!  If you cut the size of the test to 100,000 tuples, there's
only one gen2 collection in the whole run, and it's gen2 collections that
are the source of the problems.  I expect you're mostly testing what a
crappy job vmware does <wink>.