Is 4Suites xml-parser slow??? (or am i parsing in the wrong way??)

Thomas Weholt thomas at gatsoft.no
Fri Aug 3 06:12:23 EDT 2001


Hi,

A little late, but here it goes:

I tried to use tools from 4Suite some time ago and found them way too slow.
I was using it for XSLT though. It's a good project and the developers
contribute lots to the community, but for my project I switched to Sablotron
and PySablot or Sab-Py ( Can't remember which). That increased the speed
alot. 4Suite is AFAIK pure python so it's probably alwasy going to be slower
than a parser implemented in C/C++.

You can use expat directly, that would increase your parsing a great deal.
See the docs for tips.

Thomas



"teo" <teo at crepido.com> wrote in message
news:dd144f8b.0107300137.76f7f931 at posting.google.com...
> Hi all!
> I wonder if some of you have had problems (not really a problem, but
> it takes long time to parse) with xml.dom.ext.Sax2.FromXmlStream ?
> I feed the parser with an wellformed xml-file at 50k, and it takes
> 6.93 - 7.5 seconds to parse.
>
> btw, I'm running my app on an AMD-Athlon 850 Mhz Mandrake-linux PC
>
> the code in my app is:
> -------------------------
> Sourcefile = "myxml.xml" # :)
>
> from xml.dom.ext.reader.Sax2 import FromXmlStream
> import timing
>
> print "Parse!!"
> timing.start()
> dom = FromXmlStream(Sourcefile)
> timing.finish()
> print "Parsing XML into DOM took" +str(timing.milli()/1000.00000001)+"
> seconds..."
>
> -------------------------
>
> Thanks for taking your time ;)
>
> /teodor





More information about the Python-list mailing list