Posted on 15. February 2010

Профилирование Silverlight приложений

Read this article in your language IT | EN | DE | ES

Производительность приложения является одним из ключевых показателей ее работоспособности. Показатель произвводительности включает в себя такие параметры как процессорное время, которое приложение использует для вычислительных операций, размер оперативной памяти и др. При разработке приложения работать над улучшением указанных параметров можно постоянно или через определенные итерации. При этом необходимо четко представлять какие операции происходят внутри приложения. И здесь на помощь приходят различного рода диагностирующие интрументы. Далеко ходить не надо, взять хотя бы Visual Studio.

Для Silverlight приложений есть свои инструменты для диагностики. Они хоть и устапают по возможностям инструментам для веб и настольным приложениям, но использовать их можно.

Начну пожалуй из встроеных возвожностей Silverlight'a. При расположении приложения на странице тегу object можно указать несколько параметров:

  • EnableRedrawRegions - включает отображение участков Silverlight приложения, которые обновляются при каждой перерисовке фрейма.
  • MaxFrameRates - устанавлявает максимальное количество фреймов для отрисовки в секунду.
  • EnableFrameRateCounter - включает отображение счетчика отрисованых фреймов в статус панеле(только для IE).

Теперь перейдем к обзору инструментов. Будем профилировать клиент Facebook'а.

UI Spy.

 Является частью Windows SDK. Позволяет увидеть часть компонентов пользовательского интерфейса в виде дерева. Что бы увидеть определенный элемент в жереве, достаточно расположить курсор мыши над ним и нажать клавишу Ctrl. Результат:

  IU Spy

 

XPerf

 Тоже является частью Windows SDK, а точнее Windows Performance Analysis Tools. Данный инструмент позволяет узнать показатели использования системных ресурсов. Показатели снимаются со всей системы. Нет ограничения по процессам. Поэтому при его использовании рекумендуется запускать минимум сторонныих процессов. Для диагностики с помощью XPerf необходимо проделать следующие шаги:

  1. Запустить командную строку с правами администратора
  2. Установить адрес сервера сцепю символов для отображения отладочной информации: C:\Windows\system32>set _NT_SYMBOL_PATH= srv*C:\Symbols*http://msdl.microsoft.co
    m/downloads/symbols
  3. Запустить XPerf: C:\Windows\system32>xperf -on base
  4. Около 10-ти секунд будет инициализироваться инструмент после чего можно проганять Silverlight приложение.
  5. Затем останавливаем логирование и результаты пишем в файл: C:\Windows\system32>xperf -d facebook.etl
  6. Что бы посмотреть на результаты откроем их в XPerfview: C:\Windows\system32>xperfview facebook.etl

В результате откроется окно с графиками:

 Windows Performance Analyzer

 Необходимо из главного меню загрузить символы отладки: Trace -> Load Symbols

Выделяем участок графика, который нас интересует 

 Windows Performance Analyzer

и выбираем "Summary Table" пункт контекстного меню. Откроется окно с детальным описание какой процесс сколько использовал системных ресурсов (процессор в данном варианте):

CPU Sampling Summary Table

 

Как вы могли заметить в некоторых ячейках содержится значение Unknown. Дело в том, что XPerf поддерживается версиями Silverlight 1-3. У меня же установлена Silverlight 4 Beta.

 

Silverlight Spy

Silverlight Spy мощнее предыдущих инструментов, но он платный. Позволяет:

  • увидеть дерево элементов управления;
  • отслеживать события;
  • мониторить обращение приложения к серверу;
  • мониторить использование ресурсов компьютера приложением;
  • и др.

 

Silverlight Spy

 

 

Visual Studio 2010

Профилирование в "сыром виде" присутствует с Beta 2. Детальнее читайте PDC video, TechEd Iceland, VS2010, profiling, Silverlight 4.

 

EQATEC

Инстумент платный. Возможности можно увидеть здесь.

 

Как видите существует набор инстументов для профилирования Silverlight  приложений, хотя они покрывается не всё. Но данное направления еще только развивается. Еще хочу порекомендовать доклад по профилированию с PDC10.

 



Exception: Stack empty.

Comments

trackback Сергей Лутай
10:17 PM on Sunday, February 28, 2010

Профилирование Silverlight приложений

Оригинал. Производительность приложения является одним из ключевых показателей ее работоспособности.

trackback progg.ru
10:20 PM on Sunday, February 28, 2010

Sergey Lutay's Blog | Профилирование Silverlight приложений

Thank you for submitting this cool story - Trackback from progg.ru

Free PS3 Free PS3 United Kingdom
12:24 AM on Wednesday, March 17, 2010

Sorry for the huge review, but I'm really loving the new Zune, and hope this, as well as the excellent reviews some other people have written, will help you decide if it's the right choice for you.

Tony Decambra Tony Decambra United States
5:04 PM on Tuesday, April 6, 2010

You are a very smart person!

Lane Oconnor Lane Oconnor United States
5:50 PM on Friday, April 9, 2010

Your penning manner is pleasing and the way you managed the subject with grace is commendable. I am intrigued, I presume you are an expert on this topic. I just sign up for your RSS feed. Smile

Susana Macha Susana Macha United States
9:57 PM on Monday, April 12, 2010

Wow, thank you for this post. It works like a charm. I'm sorry to say that I doubted this at first.

Caitlyn Puffer Caitlyn Puffer United States
4:08 AM on Tuesday, April 13, 2010

Wow, I searched  Yahoo for this, and got a great result. Thank you for this blog post!

Brandon Foxworthy Brandon Foxworthy Brazil
1:23 AM on Monday, April 19, 2010

Perhaps you have considered adding up more videos about silverlight 4 to your weblog posts to keep the visitors more entertained? I mean I just read through the whole article of yours and it had been utterly good but since I'm more of a visual learner,I found that to become further helpful well let me know how it turns out! I enjoy what you guys are always up too. Such skillful work and reporting! Keep up the great works guys I've added you guys to my blogroll. This is a good article thanks for sharing this informative information.. I will visit your blog regularly for some latest post.

Jeremy locksmith Jeremy locksmith Syria
10:48 AM on Tuesday, April 20, 2010

Dude.. I'm not much into reading about silverlight 4 , but somehow I got to read a great deal of articles on your blog. Its amazing how interesting it is for me to visit you very often.

Long Gentes Long Gentes Dominican Republic
3:08 AM on Thursday, April 22, 2010

I was wondering what's up with that bizarre gravatar??? I know 5am is early and I'm not looking my top at that hour, however I hope I don't look like this! I might however make that face if I'm inquired to complete one hundred pushups. Smile|Smile}

Earle Liesveld Earle Liesveld United States
6:05 PM on Saturday, April 24, 2010

I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful

Enriqueta Penird Enriqueta Penird United States
9:26 AM on Thursday, May 13, 2010

hi it is my first comment on this web and in the begining I would like to thank for the great information, which I were able to find in this and all previous topics , it really helped me a lot. I will definitely add this blog on my google reader ;) Also, I would like to ask - don't you mind if I will quate some information from your website because I am writing articles for the Hub pages, Ezine and other articles directories (this is my part time job)? It would really help me with some of mine articles. Of course, I will mention your website name or URL (not all articles directories allows URL's , so I can't 100% promise that you will get a direct link to your website).

Nellie Reiff Nellie Reiff United States
8:05 AM on Friday, May 14, 2010

I wanted to say that it's nice to know that someone else also mentioned this as I had trouble finding the same info elsewhere. This was the first place that told me the answer. Thanks.

Coretta Coretta United States
8:04 AM on Saturday, May 15, 2010

Just the little boost I needed during my stressful work day. Thanks

Korey Liechti Korey Liechti United States
11:12 AM on Monday, May 17, 2010

Hi everyone. This weblog was fantastic! Lots of cool data and inspiration. Keep them coming... u all perform such an important job at writing... can not let you know just how much I, for one be thankful for all you dO!

Gedichte Gedichte United States
7:34 AM on Thursday, May 20, 2010

Hello from Germany! May i quote a post a translated part of your blog with a link to you?

Delinda Matesic Delinda Matesic United States
5:38 PM on Friday, May 21, 2010

Thank for this astonishing information. Therefore, I would like to ask for your permission to add some of this information in my blog. Of course, I will provide a link to your website, as a source of my quoted information.

Tierra Hasenfratz Tierra Hasenfratz United States
10:14 AM on Sunday, May 23, 2010

Do you know of any forums regarding this stuff?

King Car Games King Car Games United States
12:08 PM on Thursday, May 27, 2010

There is something wrong in your blog

Calico Calico United States
10:02 PM on Friday, May 28, 2010

This really is a great poster, is the first time I come here on his <STRONG>your blog</STRONG>, congratulations on your work. hugs to all.

Marcel Dumke Marcel Dumke United States
6:12 PM on Tuesday, June 1, 2010

not too shabby, thanks

Haarentfernung Haarentfernung United States
1:54 PM on Wednesday, June 2, 2010

You have inspired me, i have to write something about Sergey Lutay's Blog on my site.

Katy Wein Katy Wein United States
2:20 AM on Thursday, June 3, 2010

The topic Sergey Lutay's Blog is absolutely new for me, but it sounds very interesting. I have to read more about this topic and make me my own opinion. Thanks, Katy Wein

Rashad Mancher Rashad Mancher United States
1:49 PM on Friday, June 4, 2010

I liked this blog, I'm sure my viewers would like this as well, I'll be sure to link to this and bookmark it, thank you

Tyson Clerico Tyson Clerico United States
4:23 PM on Tuesday, June 22, 2010

This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading