Meeting the needs of your business from a distance

C# 4.0 and dynamic performance

by Mark Shiffer 30. June 2009 13:52

I read a blog post recently where someone wrote a simple test app that used 3 different methods to set a property of a class 1000 times and tracked the overall performance. The results were a bit eye-popping:

  • Reflection: 20 seconds
  • Dynamics: .6 second
  • Normal Property Setter: .01 second

Dynamics appear to offer a significant performance boost over reflection. Of course, it could/will vary with regard to how dynamic is used. I work with an application that uses a great deal of reflection and I’m interested to see how I might be able to switch it over to using dynamic more and see if I can boost performance.

Tags:

Programming

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Copyright © 2001-2010 MS Consulting, Inc. All Rights Reserved.