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


           Summary: Peformance of int switch
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


compile & run

using System;
using System.Diagnostics;

class C
{
        public static int Main ()
        {
                int r = 0;
                Stopwatch sw = new Stopwatch ();
                sw.Start ();
                for (int i = 0; i < 1000000000; ++i) {
                        switch (i % 64) {
                        case 0: case 1: case 2: case 3: case 4:
                        case 5: case 6: case 7: case 8: case 9:
                        case 10: case 11: case 12: case 13: case 14:
                                r = 0;
                                break;
                        }
                }

                sw.Stop ();
                Console.WriteLine (sw.Elapsed.ToString ());
                return r;
        }
}

Executed 3 times on same machine (Intel Dual Core)

NET

00:00:02.7247437
00:00:02.6705713
00:00:02.8542788

Mono

00:00:03.5890848
00:00:03.4114453
00:00:03.7204546


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to