[Mono-list] mcs compiles on linux. Now what?

Martin Baulig martin@gnome.org
08 Mar 2002 13:22:58 +0100


Hi,

if we're talking about optimizations, won't it make more sense to
do the optimization based on profiling data from mcs run with mono,
not with mint ?

If we start optimizing based on profiling data from mint, we may end
up trying to "optimize away" small functions which are inlined by
the runtime, but which need a function call in mint.

====
        public static long Add (long value)
        {
                return value + 1;
        }

        public static void TestIt ()
        {
                long result = 0;

                for (long count = 0; count < 1000000; count++)
                        result = Add (result);
        }
====

If I understand this correctly, this'll result in one million function
calls when run with mint, but will look more like

====
        public static void TestIt ()
        {
                long result = 0;

                for (long count = 0; count < 1000000; count++)
                        result++;
        }
====

when run with mono, so it won't make much sense to optimize this.

Same in the Array.Copy implementation, the code currently does
something like

        for (int i = 0; i < count; i++)
        {
                object value = array.GetValue (i);
                array.SetValue (value, i);
        }

which are 2*count function calls in mint, but the same than implementing
this function in C when run in mono.

Btw. does mcs already run with mono, or what needs to be done to make
it run with it ?

-- 
Martin Baulig
martin@gnome.org