python from Java

Alan Kennedy alanmk at hotmail.com
Tue Sep 7 09:22:36 EDT 2004


[Ajay]
> i have xmlproc working and i can build a minidom pretty quickly using it,
> which means i can port my exisiting DOM code to the PDA.

That's good. So now you have fallback position that gives acceptable 
performance.

> but i am going to use SAX and build the object model you mentioned and use
> that.

This will undoubtedly be faster than minidom, because you would be 
building a simpler data structure. Also, it's a great way to learn what 
DOM is actually doing for you. It's amazing how many people don't know.

> just a question, how hard would it be to actually perform the comparison
> using C. ie, pass the dom/object model to a C module and have it do the
> comparison. 

Well, that depends on the nature of the comparison operation. You'd have 
to be more specific.

> it should considerably speed up things and maybe the best time
> to try my knowledge of C. the part i am worried about with using C is
> converting the datatypes, ie the object model/minidom to something else in
> C.

Don't fall into the trap of premature optimisation.

First, make it work!
Then, make it fast!

> anyways thanks for your help and suggestions....why didn't i try xmlproc
> earlier and a dom with xmlproc is quite fast....well atleast compared to
> pxdom.

I've read several times that pxdom performance is not good. Fred Lundh 
wrote the following about it:

"Sometimes, you wonder if people who releases Python libraries has ever 
used them in any real applications. .. [snip] .. The pxdom toolkit is 
500 times slower than other portable implementations, and 3300 times 
slower than the fastest XML object implementation I have on this 
machine. Put another way, pxdom parses 4350 bytes per second on a 3 GHz 
PC. 690,000 cycles per byte. Wow."

http://online.effbot.org/2004_08_01_archive.htm#20040820

regards,

-- 
alan kennedy
------------------------------------------------------
email alan:              http://xhaus.com/contact/alan



More information about the Python-list mailing list