home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Using reflection for GUIControlFactory
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NoMoDo" data-source="post: 4220" data-attributes="member: 10381"><p>[USER=10428]JoeDalton[/USER], about the cost of regular assignments versus reflection:</p><p></p><p>Many people have different numbers on this, the simple reason being that they don't test the same thing. A call to FieldInfo.SetValue is only about 6 to 8 times more expensive. A call to Type.Invoke to do the same thing is significantly more expensive, as more reflection is involved. </p><p></p><p>If you look at the code, the test in the article you've mentioned doesn't compare regular assignments to SetValue, it compares them to GetType + reflecting on that type to find the fields we want to update + SetValue. In many cases, the first two can be amortized by using a simple cache.</p></blockquote><p></p>
[QUOTE="NoMoDo, post: 4220, member: 10381"] [USER=10428]JoeDalton[/USER], about the cost of regular assignments versus reflection: Many people have different numbers on this, the simple reason being that they don't test the same thing. A call to FieldInfo.SetValue is only about 6 to 8 times more expensive. A call to Type.Invoke to do the same thing is significantly more expensive, as more reflection is involved. If you look at the code, the test in the article you've mentioned doesn't compare regular assignments to SetValue, it compares them to GetType + reflecting on that type to find the fields we want to update + SetValue. In many cases, the first two can be amortized by using a simple cache. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Using reflection for GUIControlFactory
Contact us
RSS
Top
Bottom