17
virtual techdays INDIA 28-30 September 2011 Tune Your ASP.NET Application Using Visual Studio 2010 Profiler Abhijit Jana Consultant, Microsoft http:// abhijitjana.net | @abhijitjana

Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

Embed Size (px)

Citation preview

Page 1: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA │ 28-30 September 2011

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

Page 2: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

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

Page 3: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

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 ?

Page 4: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

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

Page 5: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

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

Page 6: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

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

Page 7: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA │ 28-30 September 2011

DEMO: Deep dive into Visual studio profiler

Abhijit Jana│ Consultant, Microsoft

Page 8: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

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

Page 9: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

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

Page 10: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA │ 28-30 September 2011

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

Page 11: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA │ 28-30 September 2011

DEMO: Compering Profiler Result

Abhijit Jana│ Consultant, Microsoft

Page 12: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA │ 28-30 September 2011

DEMO: Profiling ASP.NET Application With IIS

Abhijit Jana│ Consultant, Microsoft

Page 13: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA │28-30 September 2011

DEMO: JavaScript Profiling

Abhijit Jana│ Consultant, Microsoft

Page 14: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA │28-30 September 2011

DEMO: ASP.NET Load Testing and Profiling

Abhijit Jana│ Consultant, Microsoft

Page 15: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

• 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

Page 16: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA│28-30 September 2011

Questions & Answer

Page 17: Tune Your ASP.NET Application Using Visual Studio 2010 Profiler

virtual techdaysINDIA│28-30 September 2011

[email protected] │ http://abhijitjana.net │ @AbhijitJanaThank You