[Tutor] man pages parsing (still)

Kent Johnson kent37 at tds.net
Mon Sep 11 17:24:04 CEST 2006


Tiago Saboga wrote:
> Em Segunda 11 Setembro 2006 11:15, Kent Johnson escreveu:
>> Tiago Saboga wrote:
>> How big is the XML? 25 seconds is a long time...I would look at
>> cElementTree (implementation of ElementTree in C), it is pretty fast.
>> http://effbot.org/zone/celementtree.htm
> 
> It's about 10k. Hey, it seems easy, but I'd like not to start over again. Of 
> course, if it's the only solution... 25 (28, in fact, for the cp man page) 
> isn't really acceptable.

That's tiny! No way it should take 25 seconds to parse a 10k file.

Have you tried saving the file separately and parsing from disk? That 
would help determine if the interprocess pipe is the problem.
> 
>> I would also try specifying a buffer size in the call to os.popen2(), if
>> the I/O is unbuffered or the buffer is small that might be the bottleneck.
> 
> What's appropriate in that case? I really don't understand how I should 
> determine a buffer size. Any pointers?

To tell the truth I don't use popen myself so if anyone else wants to 
chime in that would be fine...but I would try maybe 1024 or 10240 (10k).

Kent



More information about the Tutor mailing list