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!)
Simple change for better performance of GUI rendering.
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="ojo" data-source="post: 5998" data-attributes="member: 10402"><p>I hope this comes in handy. I've looked at the source and found a small change that could spare a couple of CPU cycles....</p><p></p><p>Suggested change to Core\guilib\GUIWindow.cs</p><p></p><p>[code]public virtual GUIControl GetControl(int iControlId) </p><p>{</p><p> for (int x = 0; x < m_vecControls.Count; ++x)</p><p> {</p><p> GUIControl cntl = (GUIControl)m_vecControls[x];</p><p> </p><p> // old code</p><p> // GUIControl cntlFound = cntl.GetControlById( iControlId );</p><p> // if (cntlFound!=null) return cntlFound;</p><p></p><p> // new code</p><p> if (iControlId == cntl.GetID) return cntl;</p><p> }</p><p></p><p> return null;</p><p>}[/code]</p><p></p><p>Should help generel GUI rendering since no new object is assigned and transferred. </p><p>It's just a simple property-lookup. As far as i can tell (and test) the code performs the exact same functionality only slightly faster...</p><p></p><p>The best solution (if possible at all) would be to get rid of the for loop. But I think only Frodo can anwser if that is even possible.</p><p></p><p>;-) Ojo</p></blockquote><p></p>
[QUOTE="ojo, post: 5998, member: 10402"] I hope this comes in handy. I've looked at the source and found a small change that could spare a couple of CPU cycles.... Suggested change to Core\guilib\GUIWindow.cs [code]public virtual GUIControl GetControl(int iControlId) { for (int x = 0; x < m_vecControls.Count; ++x) { GUIControl cntl = (GUIControl)m_vecControls[x]; // old code // GUIControl cntlFound = cntl.GetControlById( iControlId ); // if (cntlFound!=null) return cntlFound; // new code if (iControlId == cntl.GetID) return cntl; } return null; }[/code] Should help generel GUI rendering since no new object is assigned and transferred. It's just a simple property-lookup. As far as i can tell (and test) the code performs the exact same functionality only slightly faster... The best solution (if possible at all) would be to get rid of the for loop. But I think only Frodo can anwser if that is even possible. ;-) Ojo [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Simple change for better performance of GUI rendering.
Contact us
RSS
Top
Bottom