LoadXml creates an xmltextreader from the "xml-string", by loading the string in a stringreader and load creates one from the stream.
The constructor is not that interesting, but may cause a carbagecollection.... So I would say, it depends.... but the difference should be minimal. Paul "When in doubt, measure, or check the il." //<disclaimer>this is all in .Net 2.0</disclaimer> -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Paul Cowan Sent: Tuesday, September 19, 2006 12:11 To: [email protected] Subject: Re: [ADVANCED-DOTNET] Load or LoadXml string or stream Hi, it really can be either I am using an XmlWriter to create the xml document. I need to send it as either an XmlDocument or an XmlDataDocument via MSMQ. I either create it via the Load or LoadXml methods. I just need to know if one performs better over the other. Thanks [EMAIL PROTECTED] > Date: Tue, 19 Sep 2006 03:14:13 -0600> From: [EMAIL PROTECTED]> Subject: Re: [ADVANCED-DOTNET] Load or LoadXml string or stream> To: [email protected]> > What object is the XML stored in before it gets to there?> -Matt> > On 9/19/06, Paul Cowan <[EMAIL PROTECTED]> wrote:> >> > Hi all,> > When loading an XmlDocument into memory, which is the faster method:> >> > 1. Load(Stream stream);> > 2. LoadXml(string xml);> >> > Thanks> >> > Paul> > ===================================> > This list is hosted by DevelopMentor(r) http://www.develop.com> >> > View archives and manage your subscription(s) at> > http://discuss.develop.com> >> > ===================================> This list is hosted by DevelopMentor(r) http://www.develop.com> > View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
