.NET Faster dynamic method invocation
At work with the varying objects that represent business entities, individuals, classes and so on.. The sheer number of properties attached to an object force us to slim down our code and use dynamic methods to avoid static calls to each of these properties when doing things like updating all elements in a collection and so forth.
An interesting approach shown on Gerhard Stephan’s blog ‘All About Nothing’ for increasing the performance on dynamic method calls has him creating a delegate to handle the request and using the ILGenerator class to embed custom OpCodes to invoke the call. Performance is really good, according to him 2000% faster.
Check out Gerhard’s post [here]
