Download presentation
Presentation is loading. Please wait.
1
May 23-24, 2012 Microsoft
2
Решение проблем производительности приложений с использованием Visual Studio 11
MAXIM GOLDIN Senior Developer at the VSU Diagnostics team Microsoft
3
Performance is important
How to improve it? Measure Fix Measure again How to measure it with VS? VS Profiler
4
What is VS Profiler? Performance measurement tool Process oriented
Ultimate Premium Professional Express
5
Common Performance Issue
High CPU utilization I/O bottleneck Tiers interaction Resource contention, Poor core utilization Memory issues
6
High CPU utilization Sampling: statistical form of CPU profiling
Choose Sampling when CPU is the critical resource Low overhead is required Non-intrusive Samples != Time
7
Sampling Profiling void Alpha() { Beta(); } void Beta() 30 samples
Exclusive Inclusive Alpha Beta 30 80 50 50 50 samples
8
Sampling Profiling Call Tree
Call Stack Main Alpha Beta Main Delta Main Alpha Beta Main Alpha Gamma
9
Sampling Profiling Call Tree
10
It is a Beta environment. You may see crushes and bugs.
Let’s mix something cool. It is a Beta environment. You may see crushes and bugs. Experiment
11
Sampling Profiling What my CPU is doing? Demo
12
Common Performance Issue
High CPU utilization I/O bottleneck Tiers interaction Resource contention, Poor core utilization Memory issues
13
I/O bottleneck Instrumentation: method timing profiling
Choose Instrumentation when CPU usage is low Exact function call counts are necessary Exact timing is necessary Higher overhead Intrusive CPU usage is low is because: blocking is an issue (I/O, locks, sontext switches)
14
Instrumentation Profiling
void MyFunction() { FUNC_ENTER(MyFunction); CALL_ENTER(WriteFile); // Call another function WriteFile(...); CALL_EXIT(WriteFile); FUNC_EXIT(MyFunction); } Elapsed Time Application Time Mention that Instrumentation can be static (VSInstr.exe) or Dynamic (JavaScript, TIP, Detours)
15
Instrumentation Profiling Call Tree
16
How long the function takes?
Instrumentation Profiling How long the function takes? Demo
17
Common Performance Issue
High CPU utilization I/O bottleneck Tiers interaction Resource contention, Poor core utilization Memory issues
18
Tiers interaction Instrumentation based
ADO.NET calls Addition to other profiling modes Collects ADO.NET data Duration and number of calls Command text VS Premium, VS Ultimate CPU usage is low is because: blocking is an issue (I/O, locks, sontext switches)
19
Tiers Interaction Profiling (TIP)
Why my DB accesses slow? Demo
20
Common Performance Issue
High CPU utilization I/O bottleneck Tiers interaction Resource contention, Poor core utilization Memory issues
21
Resource Contention Potential lock contention
void AddItems(Item[] items) void UseItems(Action<Item> doStuff) { { lock (_itemsLock) lock (_itemsLock) { { foreach (var item in items) foreach (var item in _items) _items.Add(item); doStuff(item); } } Thread 1 (producer) Thread 2 (consumer)
22
Where my synchronization blocks?
Contention Profiling Where my synchronization blocks? Demo
23
Common Performance Issue
High CPU utilization I/O bottleneck Tiers interaction Resource contention, Poor core utilization Memory issues
24
Managed memory profiling
Allocation data Allocated type Allocating call stack Lifetime data GC generations CPU usage is low is because: blocking is an issue (I/O, locks, sontext switches)
25
Do I leak my memory? (if time permits)
Managed Memory Profiling Do I leak my memory? (if time permits) Demo
26
More power to VS Profiler
Data collection Remote profiling ETW based collection Various performance counters Command line tools APIs Multiproc collection Standalone profiler Collect what you need Attach/Detach, Pause/Resume
27
More power to VS Profiler
Data analysis/visualization Filtering data By time, thread, process Compare results Save analyzed file Focus on important data Just My Code (JMC) Noise reduction
28
Available today at: http://vs11.ru
New version of Visual Studio! Available today at:
29
Related Content
30
Пожалуйста Оцените доклад и мастерство докладчика.
Форма для оценки находится в вашем инфопакете. Доклад - TLS307 Докладчик - Максим Гольдин
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.