F
FourEyes
I've read that Reflection is slow and shouldn't be used when
performance is a concern. In my case, performance is definitely a
concern, so I was thinking that I could collect the PropertyInfo
objects that I need at initialization, and then just call
PropertyInfo.SetValue() at runtime. Can anyone tell me 1) how
expensive is the call to PropertyInfo.SetValue() ? and 2) what is a
better alternative ?
I already have a hand-made solution where delegates are stored in a
Dictionary but I am hoping that .NET has something that requires less
code, ie, is auto-generated somehow.
Thanks!
performance is a concern. In my case, performance is definitely a
concern, so I was thinking that I could collect the PropertyInfo
objects that I need at initialization, and then just call
PropertyInfo.SetValue() at runtime. Can anyone tell me 1) how
expensive is the call to PropertyInfo.SetValue() ? and 2) what is a
better alternative ?
I already have a hand-made solution where delegates are stored in a
Dictionary but I am hoping that .NET has something that requires less
code, ie, is auto-generated somehow.
Thanks!