Thanks guys, great links and ideas! It looks like the MultiScaleImage control is being redrawn on every redraw of anything in the application, regardless of regions.
Im still on SL2 here at work but will test SL3 tonight and do some tracing with xperf as per your post Seema. EnableRedrawRegions is really helpful, thanks for that. John. From: [email protected] [mailto:[email protected]] On Behalf Of Seema Ramchandani Sent: Thursday, 22 October 2009 2:44 PM To: ozSilverlight Subject: RE: Determining what is causing high CPU usage Try this public profiler: http://blogs.msdn.com/seema/archive/2008/10/08/xperf-a-cpu-sampler-for-silve rlight.aspx EnableRedrawRegions is a good first hit make sure that the ProgressBar is only triggering itself to be redrawn (not the MSI). Ø Silverlight Spy showed an infinite amount of LayoutUpdated being fired, but I cant seem to get more information. Interesting, as this is not expected. Hmm, if the issue is really the progressbar, then a couple of things: - The progressbar will take less cycles if other things are happening. As in, the animation takes 40% CPU and happens at 60fps because nothing else is going on on your screen. - If even with the above, you really want to lower the CPU: o Add the indeterminate progressbar to the tree when it is actually shown o another idea, but should be used carefully, is, if only the progressbar is should be painting, to switch the maxframerate to 15 and then switch it back to 60fps when the progressbar is gone. -Seema From: [email protected] [mailto:[email protected]] On Behalf Of Ross Jempson Sent: Wednesday, October 21, 2009 7:30 PM To: ozSilverlight Subject: RE: Determining what is causing high CPU usage I was contemplating a somewhat similar thing a few days ago. Except I want to look for potential memory leaks. I have used a couple of tools in the past, including the Ants profiler. However I discovered that the Silverlight framework doesnt implement a profiling interface as per the full framework. http://www.red-gate.com/supportcenter/Content.aspx?p=ANTS%20Performance%20Pr ofiler <http://www.red-gate.com/supportcenter/Content.aspx?p=ANTS%20Performance%20P rofiler&c=knowledgebase\ANTS_Performance_Profiler\KB200809000306.htm> &c=knowledgebase\ANTS_Performance_Profiler\KB200809000306.htm It is a bit of a tangent, but you could also try an idea suggested on this list by Seema Ramchandani. You can set <param name="EnableRedrawRegions" value="true" /> in your plugin object. When I did this I was surprised to notice that a background image I hadnt considered was being constantly redrawn when a unrelated animation was in progress on the same screen. From: John OBrien [mailto:[email protected]] Sent: Thursday, 22 October 2009 11:41 AM To: 'ozSilverlight' Subject: Determining what is causing high CPU usage Hey guys does anyone have a good technique to determine exactly what is causing high CPU usage inside a Silverlight control? The example today was a ProgressBar with IsIndeterminate set to true causes a MultiScaleImage control to go crazy (40-70% CPU). Even worse is even after you hide the progressbar it never stops. <MultiScaleImage Source="GeneratedImages/dzc_output.xml" /> <ProgressBar x:Name="progress" IsIndeterminate="True" Width="400" Height="25" /> My current solution is simple trial and error to find the cause, and then remove the offending control. Silverlight Spy showed an infinite amount of LayoutUpdated being fired, but I cant seem to get more information. Any good tools out there? Ive found ProcessExplorer is awesome for monitoring the CPU usage / memory. John. ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
_______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
