visual studio 2013 profiling

21
Performance Profiling Dudayev Denis

Upload: denis-dudaev

Post on 17-Jul-2015

123 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Visual Studio 2013 Profiling

Performance Profiling

Dudayev Denis

Page 2: Visual Studio 2013 Profiling

Profiling Methods

• Sampling - collects statistical data about the work performed by an application.

• Instrumentation - collects detailed timing information about each function call.

• Concurrency - collects detailed information about multi-threaded applications.

• .NET memory - collects detailed information about .NET memory allocation and garbage collection.

• Tier interaction - collects information about synchronous ADO.NET function calls to a SqlServerdatabase.

Page 3: Visual Studio 2013 Profiling

Sampling method

• Lightweight

• Little effect on an app

• Initial exploration of the performance an app

• Investigation issues that involve using CPU

Page 4: Visual Studio 2013 Profiling

Sampling method values

• Inclusive samples - the total number of samples that are collected during the execution of the target function. (include child functions)

• Exclusive samples - the number of samples that are collected during the direct execution of the instructions of the target function. (exclude child function)

• Inclusive percent - the percentage of the total number of inclusive samples in the profiling run that are inclusive samples of the function or data range.

• Exclusive percent - the percentage of the total number of exclusive samples in the profiling run that are exclusive samples of the function or data range.

Page 5: Visual Studio 2013 Profiling

Instrumentation method

• Detailed timing for the function calls

• Investigating input/output bottlenecks such as disk I/O.

• Close examination of a particular module or set of functions.

Page 6: Visual Studio 2013 Profiling

Instrumentation method values

• Elapsed Inclusive - the total time that is spent executing the function or source line.

• Application Inclusive - the time that is spent executing the function or source line, but excluding time that is spent in calls to the operating system.

• Elapsed Exclusive - the time that is spent executing code in the body of the function or source code line. Time that is spent executing functions that are called by the function or source line is excluded.

• Application Exclusive - the time that is spent executing code in the body of the function or source code line. Time that is spent executing calls to the operating system and time that is spent executing functions that are called by the function or source line is excluded.

Page 7: Visual Studio 2013 Profiling

Concurrency method

• Collects detailed call stack information every time that competing threads are forced to wait for access to a shared resource.

• The concurrency visualizer displays graphical information that you can use to locate performance bottlenecks, CPU underutilization, thread contention, thread migration, synchronization delays, areas of overlapped I/O, and other information.

Page 8: Visual Studio 2013 Profiling

.NET Memory method

• Interrupts the computer processor at each allocation of a .NET Framework object

• Also after garbage collection

• Collects object lifetime data

• Collects a type, size, and number of objects that were created in an allocation or were destroyed in a garbage collection.

Page 9: Visual Studio 2013 Profiling

General Profiler Data Views

• Summary View – list the functions that were executing most frequently when samples were collected and the functions that were performing the most individual work.

• Call Tree View - displays the execution paths of functions in a hierarchical tree.• Modules View - organizes profiling data by module, and lists the functions, source

code lines, and instructions that were executing when samples were collected.• Caller / Callee View - displays profiling data for a selected function and the

functions that called and were called by the selected function.• Functions View - organizes profiling by function, and lists the functions that were

executing when samples were collected.• .NET Memory Allocations View - lists the types that were allocated in the profiling

run, and the call trees (execution paths) that resulted in the allocation of the type.• Object Lifetime View - lists the types that were allocated in the profiling run, and

the number of instances, size in bytes, and the garbage collection generation of the type.

• Thread Details View - displays a graphical timeline of the blocking events for each thread and lists the call stack for the blocking events.

Page 10: Visual Studio 2013 Profiling

Summary view

• Timeline Graph

• Hot Path

• Functions Doing Most Individual Work

Page 11: Visual Studio 2013 Profiling

Summary view

Page 12: Visual Studio 2013 Profiling

Function Details view

Page 13: Visual Studio 2013 Profiling

App Start Example

Page 14: Visual Studio 2013 Profiling

IEnumerable Example (Instrumentation)Issue (Summary View)

Page 15: Visual Studio 2013 Profiling

IEnumerable Example (Instrumentation)Issue ( Call Tree View)

Page 16: Visual Studio 2013 Profiling

IEnumerable Example (Instrumentation)Issue (Function Details View)

Page 17: Visual Studio 2013 Profiling

IEnumerable Example (Instrumentation)Solution (Summary View)

Page 18: Visual Studio 2013 Profiling

IEnumerable Example (Instrumentation)Solution (Call Tree View)

Page 19: Visual Studio 2013 Profiling

Example (.NET Memory)

Page 20: Visual Studio 2013 Profiling

Example (.NET Memory)

Page 21: Visual Studio 2013 Profiling

Thank you for attention