Groups | Blog | Home
all groups > dotnet academic > september 2006 >

dotnet academic : Delegate Invoke Performance


Tao
9/19/2006 8:25:02 AM
hi.. guys

I have a question about delegate invoke.

Let us say, I have a function void A() and a delegate AA which points to A().

I run A(), and AA.Invoke()

which one is faster? A() or AA.Invoke()

thanks.
Tao
9/19/2006 4:04:01 PM
Thanks, Mattias,

I still got one question, "difference is significant depends on what you're
doing". Can you give me a sample about the difference. I thought it should
not be a huge difference.

Thanks.


[quoted text, click to view]
Mattias Sjögren
9/19/2006 9:21:18 PM
[quoted text, click to view]

Invoking a method directly will likely always be faster than invoking
it through a delegate. But whether or not the difference is
significant depends on what you're doing.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Mattias Sjögren
9/20/2006 12:00:00 AM

[quoted text, click to view]

Why don't you measure it yourself?


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Tao
9/20/2006 8:58:03 AM
Thanks.


[quoted text, click to view]
AddThis Social Bookmark Button