[Mono-list] Problem with XmlTextReader

Sandaruwan Fernando sandaruwan_fernando@yahoo.co.uk
Wed, 21 Jul 2004 04:06:34 +0100 (BST)


--0-467531674-1090379194=:58940
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi,
 
Thanks for answering my question. but the problem is that i feel the XmlTextReader, just reads to the end of the stream when it is instantiated (thats why it takes so long to instantiate) and keeps this in memory. Then when the client asks for a Read() he just gives the next element or whatever. Shouldn't the parser be reading off the stream when the client gives a Read()?
 
Sandaruwan


Atsushi Eno <atsushi@ximian.com> wrote:Hi,

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
_______________________________________________
Mono-list maillist - Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


		
---------------------------------
 ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself 
--0-467531674-1090379194=:58940
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for answering my question. but the problem is that i feel the XmlTextReader, just reads to the end of the stream when it is instantiated (thats why it takes so long to instantiate) and keeps this in memory. Then when the client asks for a Read() he just gives the next element or whatever. Shouldn't the parser be reading off the stream when the client gives a Read()?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Sandaruwan</DIV>
<DIV><BR><BR><B><I>Atsushi Eno &lt;atsushi@ximian.com&gt;</I></B> wrote:
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi,<BR><BR>Sandaruwan Fernando wrote:<BR>&gt; Hi,<BR>&gt;<BR>&gt; I used XmlTextReader of .NET and found out that it is really<BR>&gt; low on performance. It takes a lot of time(in milli seconds) to<BR>&gt; create a parser object. I was wondering whether XmlTextReader<BR>&gt; is really a pull parser or whether it works like DOM internally<BR>&gt; and just gives an interface like a pull parser to the client.<BR>&gt; Does XmlTextReader in Mono work the same way?<BR>&gt;<BR>&gt; Can somebody explain how it really works?<BR><BR>First you could understand what "pull parser" is. It is no magic<BR>keyword that makes XML parser faster, but just meaning that the<BR>parser parses only when user indicates to read. For example,<BR>with XmlTextReader *you* can call Read() node-by-node. That is<BR>impossible on SAX.<BR><BR>(BTW you should also understand that document object models and<BR>X
 ML
 parsers are very different).<BR><BR>MS XmlTextReader is faster (I'd like to say, much faster) than<BR>Mono and in that there are many optimizable small tasks such as<BR>NameTable performance.<BR><BR>Atsushi Eno<BR>_______________________________________________<BR>Mono-list maillist - Mono-list@lists.ximian.com<BR>http://lists.ximian.com/mailman/listinfo/mono-list<BR></BLOCKQUOTE></DIV><p>
		<hr size=1> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://uk.rd.yahoo.com/evt=21626/*http://uk.messenger.yahoo.com"><strong>ALL-NEW 
Yahoo! Messenger</strong></a><strong> - <font color="#FF9900"><em>sooooo many 
all-new ways to express yourself</em></font></strong></font> 
--0-467531674-1090379194=:58940--