[Mono-list] Problem with XmlTextReader

Atsushi Eno atsushi@ximian.com
Sat, 17 Jul 2004 09:58:43 +0900


Sandaruwan Fernando wrote:
 > Hi,
 > I used XmlTextReader of .NET and found out that it is really
 > low on performance. It takes a lot of time(in milli seconds) to
 > create a parser object. I was wondering whether XmlTextReader
 > is really a pull parser or whether it works like DOM internally
 > and just gives an interface like a pull parser to the client.
 > Does XmlTextReader in Mono work the same way?
 > Can somebody explain how it really works?

First you could understand what "pull parser" is. It is no magic
keyword that makes XML parser faster, but just meaning that the
parser parses only when user indicates to read. For example,
with XmlTextReader *you* can call Read() node-by-node. That is
impossible on SAX.

(BTW you should also understand that document object models and
XML parsers are very different).

MS XmlTextReader is faster (I'd like to say, much faster) than
Mono and in that there are many optimizable small tasks such as
NameTable performance.

Atsushi Eno