[Mono-bugs] [Bug 79074][Wis] New - Mono places remoting calls for System.Object method

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Aug 14 18:27:38 EDT 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 brian at fluggo.com.

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

--- shadow/79074	2006-08-14 18:27:38.000000000 -0400
+++ shadow/79074.tmp.20935	2006-08-14 18:27:38.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 79074
+Product: Mono: Runtime
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: remoting
+AssignedTo: lluis at ximian.com                            
+ReportedBy: brian at fluggo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono places remoting calls for System.Object method
+
+Description of Problem:
+When calling to objects across a domain boundary, the .NET Framework 2.0
+picks out and services the following calls locally:
+
+ - Object.Equals (unless overridden remotely)
+ - Object.GetHashCode
+ - Object.ToString (unless overridden remotely)
+ - static Object.Equals
+ - MemberwiseClone
+
+These calls are run locally because they have large performance implications.
+
+(source: <http://msdn2.microsoft.com/en-us/library/h8f0y3fc.aspx>)
+
+The problem is that Mono executes these calls remotely as of r63683,
+according to Robert Jordan. Even when trying for compatibility with .NET
+1.1, this optimization can speed up some remoting scenarios.
+
+Steps to reproduce the problem:
+1. Compile and execute the following program, provided by Robert Jordan:
+
+using System;
+using System.Reflection;
+
+class Server : MarshalByRefObject
+{
+         static void Main ()
+         {
+                 AppDomain ad = AppDomain.CreateDomain ("foo");
+
+		Server s = (Server) ad.CreateInstanceAndUnwrap 
+(Assembly.GetExecutingAssembly ().FullName, typeof (Server).FullName);
+
+		TimeIt (new object ()); // lasts almost nothing
+		TimeIt (s);             // lasts a couple of secs
+         }
+
+	static void TimeIt (object o)
+	{
+		DateTime b = DateTime.Now;
+		for (int i = 0; i < 100000; i++)
+			o.Equals (null);
+		Console.WriteLine (DateTime.Now - b);
+	}
+}
+
+Actual Results:
+Calls to Equals across domains is substantially slower than calls to a
+local (non-MarshalByRefObject) object.
+
+Expected Results:
+Calls to Equals, when it's not overridden, should be just as fast in either
+scenario. In the above scenario, the framework can return false without
+placing the call.
+
+Additional Information:
+This bug could be a source of the performance problems that inspired the
+fast-xappdomain paths.


More information about the mono-bugs mailing list