[Mono-bugs] [Bug 347359] New: mcs/gmcs performance when compiling chained methods

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 10 14:38:05 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=347359


           Summary: mcs/gmcs performance when compiling chained methods
           Product: Mono: Compilers
           Version: 1.2.5
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: petee at mindtouch.com
         QAContact: mono-bugs at ximian.com
          Found By: Third Party Developer/Partner


mcs/gmcs is extremely slow when compiling code that uses a lot of chained
methods.  CPU usage spikes to 100% during compilation.

Test case:

using System;
using System.Text;

public class ChainTest {
    public static void Main(String[] args) {
    StringBuilder sb = new StringBuilder();
    sb   
AppendLine("foo").AppendLine("foo").AppendLine("foo").AppendLine("foo").AppendLine("foo")
   
AppendLine("foo").AppendLine("foo").AppendLine("foo").AppendLine("foo").AppendLine("foo")
   
AppendLine("foo").AppendLine("foo").AppendLine("foo").AppendLine("foo").AppendLine("foo")
      
AppendLine("foo").AppendLine("foo").AppendLine("foo").AppendLine("foo")//.AppendLine("foo") 
;
    }
}


Results:
5 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m0.601s
user    0m0.461s
sys     0m0.060s

10 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m1.224s
user    0m1.073s
sys     0m0.064s

15 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m1.306s
user    0m1.088s
sys     0m0.069s

16 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m1.958s
user    0m1.718s
sys     0m0.075s


17 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m3.243s
user    0m2.983s
sys     0m0.087s


18 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m5.949s
user    0m5.521s
sys     0m0.121s

19 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m11.409s
user    0m10.591s
sys     0m0.183s

20 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m22.347s
user    0m20.761s
sys     0m0.307s

21 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m23.177s
user    0m20.802s
sys     0m0.319s

22 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    0m44.146s
user    0m41.196s
sys     0m0.545s

23 chains
frog:~/monotest petee$ time gmcs StringBuilder.cs 

real    1m27.175s
user    1m22.194s
sys     0m0.991s


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list