Update of /cvsroot/mvp-xml/Common/v2/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27751/v2/test
Modified Files:
IndexingXPathNavigatorTest.cs
Log Message:
Index: IndexingXPathNavigatorTest.cs
===================================================================
RCS file: /cvsroot/mvp-xml/Common/v2/test/IndexingXPathNavigatorTest.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- IndexingXPathNavigatorTest.cs 7 Nov 2005 13:58:18 -0000 1.3
+++ IndexingXPathNavigatorTest.cs 22 Nov 2005 12:44:33 -0000 1.4
@@ -29,8 +29,9 @@
XPathDocument doc = new XPathDocument(Globals.GetResource(Globals.NorthwindResource));
//XmlDocument doc = new XmlDocument();
//doc.Load("test/northwind.xml");
- stopWatch.Stop();
+ stopWatch.Stop();
Console.WriteLine("Loading XML document: {0, 6:f2} ms", stopWatch.ElapsedMilliseconds);
+ stopWatch.Reset();
XPathNavigator nav = doc.CreateNavigator();
XPathExpression expr = nav.Compile("/ROOT/CustomerIDs/OrderIDs/Item[OrderID=' 10330']/ShipAddress");
@@ -45,15 +46,18 @@
doc.CreateNavigator());
stopWatch.Stop();
Console.WriteLine("Building IndexingXPathNavigator: {0, 6:f2} ms", stopWatch.ElapsedMilliseconds);
+ stopWatch.Reset();
stopWatch.Start();
inav.AddKey("orderKey", "OrderIDs/Item", "OrderID");
stopWatch.Stop();
- Console.WriteLine("Adding keys: {0, 6:f2} ms", stopWatch.ElapsedMilliseconds);
+ Console.WriteLine("Adding keys: {0, 6:f2} ms", stopWatch.ElapsedMilliseconds);
+ stopWatch.Reset();
XPathExpression expr2 = inav.Compile("key('orderKey', ' 10330')/ShipAddress");
stopWatch.Start();
inav.BuildIndexes();
stopWatch.Stop();
- Console.WriteLine("Indexing: {0, 6:f2} ms", stopWatch.ElapsedMilliseconds);
+ Console.WriteLine("Indexing: {0, 6:f2} ms", stopWatch.ElapsedMilliseconds);
+ stopWatch.Reset();
Console.WriteLine("Indexed selection, warming...");
SelectIndexedNodes(inav, repeat, stopWatch, expr2);
@@ -74,6 +78,7 @@
stopWatch.Stop();
Console.WriteLine("Regular selection: {0} times, total time {1, 6:f2} ms, {2} nodes selected", repeat,
stopWatch.ElapsedMilliseconds, counter);
+ stopWatch.Reset();
}
private static void SelectIndexedNodes(XPathNavigator nav, int repeat, Stopwatch stopWatch, XPathExpression expr)
@@ -89,6 +94,7 @@
stopWatch.Stop();
Console.WriteLine("Indexed selection: {0} times, total time {1, 6:f2} ms, {2} nodes selected", repeat,
stopWatch.ElapsedMilliseconds, counter);
+ stopWatch.Reset();
}
}
}
\ No newline at end of file
|