[Python-Dev] list.append optimization Was: collections module

Tim Peters tim.one at comcast.net
Tue Jan 13 14:24:08 EST 2004

[John Williams]
> Tim's optimization seems to help even more on Linux than Windows. On
> my box each iteration of the test program takes 0.80s without the
> patch and 0.27 with it.

Wow!  That's better than I had hoped for.  I'll note one subtlety:  the call
to realloc() probably endures mutex locking overhead to keep it threadsafe,
even if the realloc() is (in the end) a nop.  It certainly does under
Microsoft's realloc(), but the native locking gimmicks on Windows are very
fast (Windows loves threads).

More information about the Python-Dev mailing list