[Mono-devel-list] Re: System.Reflection Performance

Gaute B Strokkenes biggaute at uwc.net
Sun Jan 4 02:00:22 EST 2004


On 2 jan 2004, bmaurer at users.sourceforge.net wrote:

> For example, in the string case, under the hood, the .Length == 0
> translates to:
>
> string->Length == 0
>
> however, string == "" translates to:
>
> String.Equals (string, "");
>
> Thats pretty much a no brainer.

How come the compiler does not do this, then?  I mean, String is a
sealed class.  If this case is actually sufficiently common to be
worth looking for when a method is slow, then it sounds like MCS
should be doing it.

Is there some underlying reason why this a priori very simple
optimisation has not been implemented, or is there some deeper reason?

-- 
Gaute Strokkenes                        http://www.srcf.ucam.org/~gs234/
I'm having a BIG BANG THEORY!!



More information about the Mono-devel-list mailing list