HighTechTalks DotNet Forums  

Delegate Invoke Performance

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss Delegate Invoke Performance in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Tao
 
Posts: n/a

Default Delegate Invoke Performance - 09-19-2006 , 11:25 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.


Reply With Quote
  #2  
Old   
Tao
 
Posts: n/a

Default Re: Delegate Invoke Performance - 09-19-2006 , 07:04 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.


"Mattias Sjögren" wrote:

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

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
Please reply only to the newsgroup.


Reply With Quote
  #3  
Old   
Tao
 
Posts: n/a

Default Re: Delegate Invoke Performance - 09-20-2006 , 11:58 AM



Thanks.


"Mattias Sjögren" wrote:

Quote:
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.

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
Please reply only to the newsgroup.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.