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 [EMAIL PROTECTED]

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

--- shadow/81981        2007-06-30 06:44:49.000000000 -0400
+++ shadow/81981.tmp.15711      2007-06-30 06:44:49.000000000 -0400
@@ -0,0 +1,119 @@
+Bug#: 81981
+Product: Mono: Runtime
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: JIT
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PERF] Up to 4x slower unsafe code
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. 
+
+using System;
+
+
+
+class C
+
+{
+
+       public static void Main()
+
+       {
+
+               Test_Orig ();
+
+       }
+       
+
+       public static unsafe void Test_Orig()
+
+       {
+
+               byte[] a = new byte[10000];
+
+               
+
+               long start = Environment.TickCount;
+
+               byte red, green, blue;
+
+               fixed (byte* fixed_array = &a[0])
+
+               {
+
+                       for (int runs = 0; runs < 100000; runs++)
+
+                       {
+
+                               byte* pointer = fixed_array;
+
+                               byte* end = fixed_array + 999;
+
+
+
+                      while (pointer < end)
+
+                      {
+
+                           blue = pointer[0];
+
+                           green = pointer[1];
+
+                           red = pointer[2];
+
+                           pointer[0] = pointer[1] = pointer[2] = (byte)(red *
+0.3 + green * 0.59 + blue * 0.11);
+
+                           pointer += 3;
+
+                       }
+
+                   } 
+
+               }
+
+               
+
+               long end_c = Environment.TickCount - start;
+
+               Console.WriteLine ("End Orig = " + end_c);
+
+       }
+
+}
+
+Actual Results:
+
+Compiled by mcs
+
+Mono: 657
+MS: 297
+
+Compiled by csc
+
+Mono: 960
+MS: 250
+
+Expected Results:
+
+Similar performance
+
+Additional Information:
+
+I am wondering whether I should change mcs to produce different code too.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to