http://bugzilla.novell.com/show_bug.cgi?id=524595

User [email protected] added comment
http://bugzilla.novell.com/show_bug.cgi?id=524595#c1


Antonio Cuni <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]




--- Comment #1 from Antonio Cuni <[email protected]>  2009-07-23 07:54:16 MDT 
---
after more investigation, I discovered that the culprit is not the try/catch
nor the overflow checking; a temp variable is enough to make the code ~4x
slower even with a very simple loop:

    public static int Fast()
    {
        int i = 0;
        int step = 3;
        while (i < N) {
            i = i + step;
        }
        return i;
    }

    public static int Slow()
    {
        int i = 0;
        int step = 3;
        int tmp = 0;
        while (i < N) {
            tmp = i + step;
            i = tmp;
        }
        return i;
    }


viper tmp $ mono tempvar2.exe 
Fast:  00:00:00.1746620
Slow:  00:00:00.6593390

-- 
Configure bugmail: http://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