[Mono-bugs] [Bug 77792][Maj] New - Poor performace of
Int32.ToString () and other primite types
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Mar 15 14:25:01 EST 2006
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 marek.safar at seznam.cz.
http://bugzilla.ximian.com/show_bug.cgi?id=77792
--- shadow/77792 2006-03-15 14:25:01.000000000 -0500
+++ shadow/77792.tmp.23351 2006-03-15 14:25:01.000000000 -0500
@@ -0,0 +1,73 @@
+Bug#: 77792
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: marek.safar at seznam.cz
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Poor performace of Int32.ToString () and other primite types
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+It looks like all primite ToString operation are too slow in compare to
+Microsoft implementation.
+Because this part is used heavily, I am raising this as the major issue.
+
+
+Steps to reproduce the problem:
+1.
+
+using System;
+using System.Collections;
+
+class C
+{
+ static DateTime startTime;
+ static DateTime stopTime;
+ static TimeSpan elapsedTime;
+
+ public static void Main ()
+ {
+ long elapsedMilliseconds;
+ startTime = DateTime.Now;
+ const int n = 1000000;
+
+ for(int i=1; i<=n; i++)
+ {
+ string s = i.ToString("x");
+ }
+
+ stopTime = DateTime.Now;
+ elapsedTime = stopTime.Subtract(startTime);
+ elapsedMilliseconds = (int)elapsedTime.TotalMilliseconds;
+
+ Console.WriteLine("Elapsed time: " + elapsedMilliseconds + " ms");
+ }
+}
+
+Actual Results:
+
+Mono Runtime: Elapsed time: 3405 ms
+
+7 times slower.
+
+Expected Results:
+
+Microsoft .NET runtime: Elapsed time: 490 ms
+
+
+How often does this happen?
+
+
+Additional Information:
More information about the mono-bugs
mailing list