Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance and diagnostics tools for Silverlight

WPF 3.5 has PresentationTraceSources for diagnostics and WPFPerf for performance and data binding diagnostics.

Are there equivalent tools / libraries for Silverlight?

like image 506
Richard Szalay Avatar asked Sep 25 '09 07:09

Richard Szalay


3 Answers

Although I've marked Paully's answer as "the answer", I thought I'd summarise what I've found so far.

Performance:

  • EnableRedrawRegions can be used to automatically draw rectangles around areas that are being redrawn
  • MaxFrameRate and EnableFramerateCounter can be used for seeing how certain controls/animations affect the framerate.
  • XPerf can be used for diagnosing CPU performance

Diagnostics:

  • Silverlight Spy can view live XAML DOM
  • Data Binding tracing cannot be configured since the code does not use trace switches/sources. Binding errors are written directly to Trace.Write and the WPF SourceUpdated/TargetUpdated events are not available in Silverlight.
like image 155
Richard Szalay Avatar answered Oct 20 '22 22:10

Richard Szalay


I don't think it's as robust as WPF but here is some things you can do.

like image 33
Paully Avatar answered Oct 20 '22 22:10

Paully


Right, so while I'm certain that possessing a myriad of perf diagnostics tools is fun, what exactly are you trying to accomplish?
Looking at WPF diagnostics tools you've mentioned I could only think "pffff, so what? These are useless 99.999% of the time". Most of that data is fairly useless when it comes down to actually debugging a real world app. Those tools are mostly relevant when debugging the WPF framework itself IMO.

It's definitely true that there's a shortage of good diagnostics tools for some issue in Silverlight.
For instance, there are 0 Silverlight commercial memory profilers out there. But beyond that, I'm unsure as to why you need more than those. So, which tools exactly do you need?

Now that I'm done being smug and uplifting (all at the same time), I'll call out 2 tools you've missed:
1. Silverlight SOS (Son-Of-Strike) extension: Works just like the desktop SOS extension but with a few more extra commands and you'll have to load a silverlight specific sos.dll. This tool is excellent for in-depth memory profiling, learn more about it here and here.
2. The Silverlight3 Analytics class. Using this class you can get the CPU% for your process, the whole CPU usage and the specific model and make for the GPU card.
3. Glimpse for Silverlight - A DataBinding debugging "tool"/control by Karl Shifflett.

like image 1
JustinAngel Avatar answered Oct 20 '22 23:10

JustinAngel