[Mono-bugs] [Bug 27796][Nor] New - patch to speed to mono_class_vtable

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
15 Jul 2002 16:17:25 -0000


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 vargaz@freemail.hu.

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

--- shadow/27796	Mon Jul 15 12:17:25 2002
+++ shadow/27796.tmp.23944	Mon Jul 15 12:17:25 2002
@@ -0,0 +1,27 @@
+Bug#: 27796
+Product: Mono/Runtime
+Version: unspecified
+OS: Debian Woody
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vargaz@freemail.hu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: patch to speed to mono_class_vtable
+
+I noticed that mono_array_new and mono_string_new make a lot of calls to
+mono_class_vtable, which is slow, since it contains a lock + a hastable
+lookup. The attached patch speeds this up by avoiding the lock+lookup pair in
+the most common case, which is: only one appdomain, vtable already built.
+I believe the patch is thread safe. 
+A benchmark: mcs compiling itself on a 1GHz linux
+
+before: 16.9 sec
+after: 14.3 sec (-15%)