[Mono-bugs] [Bug 68453][Nor] New - Performance problems with ldftn in wrapper functions

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 16 Oct 2004 17:14:02 -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 bmaurer@users.sf.net.

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

--- shadow/68453	2004-10-16 17:14:02.000000000 -0400
+++ shadow/68453.tmp.1655	2004-10-16 17:14:02.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 68453
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: bmaurer@users.sf.net                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Performance problems with ldftn in wrapper functions
+
+Today, we use ldftn in wrapper functions in order to call managed code.
+This is basically a workaround for a few issues. We can get much better
+performance if we use a normal call.
+
+The problem is that ldftn needs a lock to work. So, you create un-needed
+contention. For example, the following test case takes a very long time to
+complete on an smp box:
+
+using System;
+using System.Threading;
+class X : MarshalByRefObject {
+	static void Main ()
+	{
+		for (int i = 0; i < 4; i ++) {
+			Thread t = new Thread (new ThreadStart (A));
+			t.IsBackground = false;
+			t.Start ();
+		}
+	}
+	
+	static void A ()
+	{
+		X x = new X ();
+		for (int i = 0; i < 100000000; i ++)
+			x.Y ();
+	}
+	
+	void Y ()
+	{
+	}
+}
+
+(the wrapper in use here is the remoting one)