Tuesday, December 1, 2009

someDelegate.Invoke(); is about 1.3 times slower then a direct method call, and the same as calling the delegate itself.

dynamic blah = someDelegate; blah.Invoke(); is just under 10 times slower than method call, which is close enough for me (since a loop of 10,000,000 calls takes 770ms). ((dynamic)someDelegate).Invoke(); is marginally faster and is easier to use.

Delegate blah = someDelegate; blah .DynamicInvoke(); is about 550 times slower than a method call and doesn't add any value over using a dynamic.

It looks like I'll be using dynamics.


Tidied up some stuff. That should be enough tidying for now, back to page turning stuff.

No comments:

Post a Comment