Try to look at this article (watch for line breaks):

http://msdn.microsoft.com/webservices/building/xmldevelopment/msxml/defa
ult.aspx?pull=/library/en-us/dnexxml/html/xml02212000.asp

it gives the general information about XML DOM document performance and
memory usage.
 
Yuri Misnik


-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Adam Sills
Sent: Saturday, June 07, 2003 2:44 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] How expensive is XmlDataDocument

You can enlighten yourself. Spend a few minutes and write your own test
that
does the same thing both ways and simply time it. Then repeat it x
number of
times (where x is really big). I just did as much and the
XmlDataDocument
beat the DataSet speed-wise. Granted, I had to remember how to write the
stupid XPath query so the XmlDataDocument took me way longer to write :)

static void Main(string[] args)
  {
   int count = 1000;

   StartCount();
   for(int i = 0; i < count; i++)
   {
    DataSet data = GetDataSet();
    DataRow[] rows = data.Tables[0].Select("bMulticast=false");
   }
   EndCount("DataTable.Select took\r\n{0}");

   StartCount();
   for(int i = 0; i < count; i++)
   {
    DataSet data = GetDataSet();
    XmlDataDocument doc = new XmlDataDocument(data);
    XmlNodeList list =
doc.SelectNodes("//Table[bMulticast[.='false']]");
   }
   EndCount("XmlDataDocument.SelectNodes took\r\n{0}");

   Console.ReadLine();
  }

  static DateTime start;

  static void StartCount()
  {
   start = DateTime.Now;
  }

  static void EndCount(string format)
  {
   DateTime end = DateTime.Now;
   TimeSpan diff = end - start;

   Console.WriteLine(format, diff);
  }

  static DataSet GetDataSet()
  {
        //build and return a dataset
   }
> -----Original Message-----
> From: Torsten Kramer [mailto:[EMAIL PROTECTED]
> Sent: Freitag, 6. Juni 2003 15:16
> To: [EMAIL PROTECTED]
>
> Hi,
>
> I've one of these very pretty DataSet instances. But I don't
> want to use SQLs select syntax to query my DataSet, I want to
> use XPath. Therefore I attach my DataSet to an XmlDocument
> and use SelectSingleNode or even the methods of
> IXPathNavigator. But what does this cost with respect to
> performance and memory consumption? What is faster -
> DataTable.Select or XmlDocument.SelectNode/SelectSingleNode?
>
> Who can enlighten me?

Reply via email to