Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

Preview:

Citation preview

virtual techdaysINDIA │ 28-30 September 2011

Tune Your ASP.NET Application Using Visual Studio 2010 ProfilerAbhijit Jana │ Consultant, Microsofthttp://abhijitjana.net | @abhijitjana

Introducing Profiling Introducing Visual Studio 2010 Profiler Choose right Profiling Methods Deep dive into Visual studio profiler Use different techniques of profiling with asp.net apps Profile ASP.NET applications with IIS Profiling JavaScript ASP.NET load testing and Profiling Q/A

virtual techdaysINDIA │ 28-30 September 2011

S E S S I O N A G E N D A

Performance of an application is a key element that should be analyzed and optimized before it go for live.

The most common use of profiling information is to help application performance optimization.

This helps to find out memory usages, usage of particular instructions, check for CPU Utilization or frequency and duration of specific function calls.

Analyze your application performance, review and optimize your code then rerun the profiler.

Compare the result with your baseline result. Let your code fly

virtual techdaysINDIA │ 28-30 September 2011

Introducing ProfilingWhy do we need this ? Why it is important ?

virtual techdaysINDIA │ 28-30 September 2011

Application Profiling Life CycleJust look into the different steps of Application Profiling

Run ProfilerRun Profiler

Performance ReportPerformance Report

ApplicationApplication

Analyze Reports Code OptimizationCode Optimization

Compare Performance ReportCompare Performance Report

Microsoft Visual Studio 2010 comes with built-in profiling tools that offer developers to analyze their application.

Very Powerful tooling support to analyze. Visual Studio Profiling Tools support below methods of collecting

performance data Sampling Instrumentation Memory Allocation Concurrency

Supports JavaScript Profiling and Tier Interaction (TIP) It’s also helps to compare different performance reports

virtual techdaysINDIA │ 28-30 September 2011

Introducing Visual Studio 2010 Profiler Applicable with only Visual Studio 2010 Ultimate and Premium Edition

virtual techdaysINDIA │ 28-30 September 2011

Choose right Profiling Methods First know which method is suitable for your application.

Sampling : This is useful for initial analysis of your application. Use sampling for analyzing CPU utilization issues.

Instrumentation : Inspect the time for all functions used in the application during the current profile

session. Check for all call out and call in functions For analyzing input/output performance issues.

Memory Allocation : This uses sampling profiling method to collects .NET Framework memory allocation data

Concurrency : Visualize the behavior of Multithread application

virtual techdaysINDIA │ 28-30 September 2011

DEMO: Deep dive into Visual studio profiler

Abhijit Jana│ Consultant, Microsoft

virtual techdaysINDIA │ 28-30 September 2011

Inside SamplingKnow something more about Sampling Profiling

Visual Studio Profiler collects the function call stack by sending some interrupts the computer processor at set of intervals.

The profiler analysis determines whether the processor is executing code in the target process.

If the processor is executing the target code, the profiler increments the sample counts for each function on the call stack

Measurements Inclusive samples Exclusive samples Inclusive percent Exclusive percent

http://msdn.microsoft.com/en-us/library/ms242753.aspx

ProfilerProfiler

virtual techdaysINDIA │ 28-30 September 2011

Inside InstrumentationKnow more about Instrumentation

Visual Studio Profiling Tools injects code at the start and end of target functions in the profiled binary

This also inject codes before and after each call by instrumented functions to other functions.

Main Measurement Elapsed Inclusive Elapsed Exclusive Application Inclusive Application Exclusive

http://msdn.microsoft.com/en-us/library/ms182369.aspx

virtual techdaysINDIA │ 28-30 September 2011

DEMO: Using Instrumentation With ASP.NET ApplicationAbhijit Jana│ Consultant, Microsoft

virtual techdaysINDIA │ 28-30 September 2011

DEMO: Compering Profiler Result

Abhijit Jana│ Consultant, Microsoft

virtual techdaysINDIA │ 28-30 September 2011

DEMO: Profiling ASP.NET Application With IIS

Abhijit Jana│ Consultant, Microsoft

virtual techdaysINDIA │28-30 September 2011

DEMO: JavaScript Profiling

Abhijit Jana│ Consultant, Microsoft

virtual techdaysINDIA │28-30 September 2011

DEMO: ASP.NET Load Testing and Profiling

Abhijit Jana│ Consultant, Microsoft

• Beginners Guide to Performance Profiling• Analyzing Application Performance by Using Profiling Tools• How to Profile IIS Express with Visual Studio 2010 SP1

virtual techdaysINDIA │ 28-30 September 2011

Useful Resources

virtual techdaysINDIA│28-30 September 2011

Questions & Answer

virtual techdaysINDIA│28-30 September 2011

abhijan@microsoft.com │ http://abhijitjana.net │ @AbhijitJanaThank You

Recommended