Do you know ildasm in the .NET framework SDK? It's a tool=20
that lets you see MSIL, the intermediate language used by=20
the CLR. If you look at your MSIL for an accessor, you'll=20
see that it is transformed into a method=20
(get_MyAccessorName, set_MyAccessorName). You could also=20
try to name a method get_MyAccessorName; the compiler will=20
pop an error (I just did :)).
So my guess is that there's no point in your question=20
because your accessor is indeed a method, so there's no=20
performance difference and both are inlined. But maybe a=20
more clever guy will prove me that I'm wrong ;)
Peace
Fran=E7ois Lemaire
[quoted text, click to view] >-----Original Message-----
>Hi,
>
> Since small method calls are inlined when the IL size=20
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=20
therefore poped onto
>the stack so obviously slower than the propget.
>
> When it is inline its not pushed onto the stack, but it=20
is JITted to be
>inline wheras a prop is what?
>
> Is there a difference or is it smart enough? Does the=20
method take ahit on
>the initial JIT and the propget doesnt?
>
>Thanks
>
>
>.