Amazon.com Widgets

Only for the CLR Geeks

For those true CLR geeks --- you will love this MSDN TV spot with Joe and Joel talking about CLR Method Dispatch.  Let us hear what you think about it.. and what other topics we should cover…

 

Published 04 November 05 01:03 by BradA
Filed under:

Comments

# Smith said on November 5, 2005 2:09 AM:
Nice information brad! but my concern is What about the CLR Performance on Dynamic Method Invocation(Dynamic Method - Delegate Invoke)???
# joelpob said on November 8, 2005 5:15 PM:
Hi,

If you're question is asking "What is the approximate performance of invoking a dynamic method with a delegate" then it's the cost of a delegate call, plus the cost of the IL emitted. So if you have a simple "call" IL instruction in your DM, then the cost is delegate call + call instruction. Pretty cheap.

As it turns out, the IL will probably need to have some logic for tests: check to see if the callsite has the same number of arguments and the receiver, check that the types of each argument matches that of the parameter and coerce if it doesn't match, etc etc. That costs a little extra too.

In the end, do what RicoM does - measure measure measure :)

cheers
-Joel.
# Brad Abrams Only for the CLR Geeks | Wood TV Stand said on May 31, 2009 7:38 PM:

PingBack from http://woodtvstand.info/story.php?id=3949

New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker