[Mono-list] mcs targets/definitions

Miguel de Icaza miguel@ximian.com
13 Sep 2003 20:05:44 -0400


hello,

>  > Does the debug flag affect performance of the generated IL?
> 
> Any takers?

The -g compiler flag does not affect execution performance.  It only
makes the .exe file larger by including the debugging information into
it (and the build is slightly slower as you have to generate it).

The --debug argument to the Mono runtime will.  The reasons described by
Jonathan are right on track:

> My partial answer is that there need not be a reason for debug
> information to impact performance.  The primary reason C code has a
> performance degradation with debug code is that x86 code loses a
> register to store the "frame pointer," which is used to generate
> accurate stack traces.  x86 is register starved as it is, so this
> greatly contributes to the decline in code, assuming the code
> optimizations are enabled.


>  > (2) Is there a macro defintion built into the MCS compiler on the order 
> of,
>  > say, "MONO," so that conditional compilation can occur if, on the outside
>  > chance, the implementation is not perfectly alligned with the MS FCL?
> 
> Yes... and No.  Yes, mcs defines __MonoCS__ symbol... and you should
> ignore it. :-)
> 
> You should ignore it because it only says that your code is being
> compiled with mcs.  It doesn't say that you're running under Mono on
> Linux, Mono on Windows, or under .NET.  Which amounts to making it
> worthless for signaling platform-dependent code.

This is a very good comment.  I have updated the man page to reflect the
above suggestion.

Miguel