[XML-SIG] HTML<->UTF-8 'codec'? [Slightly-OT]

Martin v. Loewis Martin.v.Loewis@t-online.de
Sat, 20 Oct 2001 23:07:08 +0200


> Not so, Martin.  The tests I quoted in my last post added a single
> character at a time, and insert/append gave dramatic improvements.
> The list may be cpoied on each resize but apparently it doesn't have
> to resize very often, just like a dictionary doesn't have to, resize
> on each new addition.

Right, I forgot about the overallocation. Note that repeated list
.append calls still gave an algorithm of quadratic time in Python 1.5,
since the overallocation extended the list size by at most 100
elements. Only in 2.1, such an algorithm is of linear complexity,
since the overallocation grows with the list size.

Regards,
Martin