[Expat-discuss] is expat a reentrant parser
Fred L. Drake, Jr.
Thu, 2 Aug 2001 13:36:11 -0400 (EDT)
> Is expat reentrant?
I'm not entirely sure what you mean here. If you create several
parsers, you should be able to use them at the same time (from
different threads or whatever). You probably don't want to muck
around with a parser while it is actively parsing, aside from calling
the defined APIs to add/change callbacks.
> Is expat thread safe?
My answer above should be sufficient; if not, please explain what
you mean. Realize that while Expat is parsing, it controls the flow
in its thread.
> Also, with xerces , to process 40000 elements using SAX
> ( size of xml buffer is roughly 2MB)
> takes 8 secs. I want to get it down to a couple of secs. Please advice.
Just measure it -- you didn't say anything about your hardware, so
no one has any way to judge, even if they've already done relevant
measurements (I haven't).
If Expat is fast enough, that's great. If not, there are other
parsers available. I don't really have the resources to spend
performance-tuning Expat unless you want to fund the work through my
Fred L. Drake, Jr. <fdrake at acm.org>
PythonLabs at Zope Corporation