Danny Yoo wrote:

> If I really had to guess, without profiling information, I'd take a very 
> close look at the characters() method: it's doing some string 
> concatentation there that may have very bad performance, depending on the 
> input.  See:
> 
>      http://mail.python.org/pipermail/tutor/2004-August/031568.html
> 
> and the thread around that time for details on why string concatentation 
> should be treated carefully.

Gee, Danny, it's hard to disagree with you when you quote me in support 
of your argument, but...the characters() method is probably called only 
once or twice per tag, and the string is reinitialized for each tag. So 
this seems unlikely to be the culprit.

Course it helps that I have read to the end of the thread - the problem 
seems to be accessing the external DTD ;-)

By the way that article of mine is obsoleted by Python 2.4, which 
optimizes string concatenation in a loop...
http://www.python.org/doc/2.4.3/whatsnew/node12.html#SECTION0001210000000000000000

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to