[Mono-bugs] [Bug 59537][Nor] Changed - improve NameTable performance

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 15 Sep 2004 22:24:57 -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 mono@bitfurnace.com.

http://bugzilla.ximian.com/show_bug.cgi?id=59537

--- shadow/59537	2004-09-15 22:20:47.000000000 -0400
+++ shadow/59537.tmp.27099	2004-09-15 22:24:57.000000000 -0400
@@ -408,6 +408,40 @@
 Miguel.
 
 ------- Additional Comments From mono@bitfurnace.com  2004-09-15 22:20 -------
 Created an attachment (id=10749)
 proposed replacement for mono NameTable implementation
 
+
+------- Additional Comments From mono@bitfurnace.com  2004-09-15 22:24 -------
+I created a possible NameTable replacement.
+
+Seems to be about 10% faster than the current Mono one, and about 5%
+faster than the current Microsoft one.
+
+In the post above you will find my code, below is the test:
+
+static void Main(string[] args)
+{			
+	test(new MonoNameTable());
+	test(new MyNameTable());
+	test(new NameTable());
+
+	Console.ReadLine();
+}
+
+static void test(XmlNameTable nt)
+{
+	Random r = new Random(0);
+	int t0 = Environment.TickCount;
+	for (int i = 0; i < 1000000; i++)
+	{
+		char[] str = r.Next(10000).ToString().ToCharArray();
+		nt.Add(str, 0, str.Length);
+	}
+	Console.WriteLine(Environment.TickCount - t0);
+}
+
+Im getting the following results:
+Mono NameTable      992
+My NameTable        881
+Microsoft NameTable 951