[Mono-bugs] [Bug 59537][Nor] Changed - improve NameTable performance
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 9 Jun 2004 12:07:36 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by atsushi@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=59537
--- shadow/59537 2004-06-09 10:52:46.000000000 -0400
+++ shadow/59537.tmp.32372 2004-06-09 12:07:36.000000000 -0400
@@ -273,6 +273,123 @@
------- Additional Comments From bmaurer@users.sf.net 2004-06-09 10:52 -------
Ok, atsushi's test case is not quite right. He does not take advantage
of the new impl that much. Basically, the problem is that we are not
querying on names that are already in the table -- every query in
eno's benchmark is unique. This is not how the code is designed.
+
+------- Additional Comments From atsushi@ximian.com 2004-06-09 12:07 -------
+I know. That example is one extreme case (though I could even
+delete the second iteration of AddBatch()). I am not saying "look at
+this. existing implementations MUST be faster than new thing". That's
+not the point.
+
+But if you think that new implementation must be faster in practical
+case, I cannot agree, since I actually compared the performance data.
+
+Common to all the cases, the processing speed is almost the same.
+However, memory consumption is
+
+Example #1 : read large document that contains many identical names.
+
+using System;
+using System.Xml;
+
+public class Test
+{
+ public static void Main ()
+ {
+ XmlTextReader xtr = new XmlTextReader ("TestResult.xml");
+ while (!xtr.EOF)
+ xtr.Read ();
+ }
+}
+
+$ cp ~/cvs/mcs/class/System.Data/TestResult.xml . // example
+
+$ mono --profile test.exe > nt-perf-new.txt [-old.txt]
+
+// Old one
+Total time spent compiling 371 methods (sec): 0.07
+Slowest method to compile (sec): 0.01:
+System.Globalization.CultureInfo::ConstructCalendars()
+Time(ms) Count P/call(ms) Method name
+########################
+ 350.000 1 350.000
+System.Object::runtime_invoke_void(object,intptr,intptr,intptr)
+
+------
+Total memory allocated: 263 KB
+
+// new one
+Total time spent compiling 393 methods (sec): 0.06
+Slowest method to compile (sec): 0.01: System.IO.Path::GetFullPath(string)
+Time(ms) Count P/call(ms) Method name
+########################
+ 380.000 1 380.000
+System.Object::runtime_invoke_void(object,intptr,intptr,intptr)
+
+------
+Total memory allocated: 442 KB
+
+
+Example #2 : XSLT test performance
+
+$ cd mcs/class/System.XML/Test/System.Xml.Xsl/standalone_tests
+$ make test
+
+// Old one
+Total time spent compiling 2854 methods (sec): 0.542
+Slowest method to compile (sec): 0.011:
+System.Xml.XmlDocument::.ctor(XmlImplementation,XmlNameTable)
+Time(ms) Count P/call(ms) Method name
+########################
+ 425375.000 9307 45.705 Mono.Xml.Xsl.XslTransformProcessor::
+
+------
+Total memory allocated: 850815 KB
+
+
+// New one
+Total time spent compiling 2851 methods (sec): 0.43
+Slowest method to compile (sec): 0.01:
+System.Array::Copy(Array,int,Array,int,int)
+Time(ms) Count P/call(ms) Method name
+########################
+ 438493.000 9307 47.114 Mono.Xml.Xsl.XslTransformProcessor::
+
+------
+Total memory allocated: 854028 KB
+
+
+Example #3 - Other than those tests above, I also tried DataSet & XML
+tests (I've received from julia; that has 1.8MB of xml, with 50kb of
+schema), but its not reproducable on your side. Just attaching FYI;
+
+// Old one
+Total time spent compiling 1627 methods (sec): 0.33
+Slowest method to compile (sec): 0.03: I18N.Common.Handlers::.cctor()
+Time(ms) Count P/call(ms) Method name
+########################
+ 33035.000 11930 2.769
+System.Data.XmlDataReader::ReadElement(DataRow)
+
+------
+Total memory allocated: 12942 KB
+
+// New one
+Total time spent compiling 1624 methods (sec): 0.451
+Slowest method to compile (sec): 0.08:
+System.Xml.Schema.XmlSchemaSimpleTypeRestriction::Validate(ValidationEventHandler,XmlSchema)
+Time(ms) Count P/call(ms) Method name
+########################
+ 35599.000 11930 2.984
+System.Data.XmlDataReader::ReadElement(DataRow)
+
+------
+Total memory allocated: 17311 KB
+
+
+I have no intention to deny the possible case that the new
+implementation is faster, but cannot agree blindly without the
+concrete data.
+