[Python-Dev] Optimization of the Year

Raymond Hettinger python at rcn.com
Wed Feb 11 01:31:50 EST 2004


[Hye-Shik]
> I made an updated patch very slightly modified from Raymond's.
> Dropped use of track_* member variables and applied simpler extra
> size calculation suggested by Tim.
> 
>  http://people.freebsd.org/~perky/list-r2.diff.txt

We have a winner.  It has most of the performance benefits with no 
space trade-off.

It is not as automatic as the previous patch.
The patch had to add code to list_sort() to trap the temporary
alteration of ob_item.  If similar tricks get used in extensions,
they will need to add "list->allocated = -1;" to invalidate the
previous allocation size.

If there are no dissents, I will check this in.


Raymond


#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################



More information about the Python-Dev mailing list