Alex Rivera | Logout

Reflection.Emit better than GetValue & SetValue :S

Asked 2009-11-26T15:31:53.317
18

I've been told to use Reflection.Emit instead of PropertyInfo.GetValue / SetValue because it is faster this way. But I don't really know what stuff from Reflection.Emit and how to use it to substitute GetValue and SetValue. Can anybody help me with this ?

Edit
Report

1 Answer

1

Using Reflection.Emit seems a little too "clever", as well as a premature optimization. If you profile your application, and you find that the GetValue/SetValue Reflection is the bottleneck, then you could consider optimizing, but probably not even then...

answered 2009-11-26T15:43:22.510

Your Answer