[Mono-bugs] [Bug 68723][Nor] New - Recursive code runs very slowly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 24 Oct 2004 01:37:40 -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 writeonlymemory@gmail.com.

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

--- shadow/68723	2004-10-24 01:37:40.000000000 -0400
+++ shadow/68723.tmp.32705	2004-10-24 01:37:40.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 68723
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: Debian Sarge/Kernel 2.4.26-1-k7
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: writeonlymemory@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Recursive code runs very slowly
+
+Description of problem:
+The Mono runtime seems to have a lot of overhead in making a function call.
+ I discovered this when implemented a simple 'power' algorithm for a CS
+class -- the O(n) algorithm ran faster than the O(lg n) algorithm in Mono.
+ This is clearly bogus.  I later verified that this is NOT the case with
+the Microsoft runtime.
+
+Steps to reproduce the problem:
+1. Write any sort of recursive algorithm (or anything that makes a lot of
+function calls).
+2. Run it in Mono.
+3. Witness the terrible performance.
+
+Actual Results:
+Code runs very slowly.
+
+Expected Results:
+Code runs fast.
+
+How often does this happen? 
+All the time.
+
+Additional Information:
+The byte code generated isn't the problem -- running the resultant image
+(generated by mcs) works fine with the Microsoft runtime (.NET Platform
+1.1).  Also, if you run the binary with mint, not mono (ie, skipping JIT)
+then the O(lg(n)) algorithm runs faster than the O(n) algorithm as
+expected, but if you run it with mono, the O(n) algorithm runs much faster.
+ This leads me to think that it must be something to do with JIT.
+
+I'll be happy to help fix the bug, I just don't know where to start and no
+one was interested in helping out on #mono.  Please contact me for more
+details.