I would think it is smart enough. The reason being is that properties
are really methods (you will notice get_Property and set_Property methods on
your class when you look at the IL), and I would imagine that these are
subject to the same optimizations.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
<di********@discussion.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
Since small method calls are inlined when the IL size is 32 or less.
Take for example..
// Method (inlined)
public bool getVal()
{
return someVal;
}
// propget
public bool Val
{
ge { return someVal; }
}
Which is faster? If the method is unoptimised its therefore poped onto
the stack so obviously slower than the propget.
When it is inline its not pushed onto the stack, but it is JITted to be
inline wheras a prop is what?
Is there a difference or is it smart enough? Does the method take ahit
on the initial JIT and the propget doesnt?
Thanks