performance managment

14
e(i < int.MaxValue) { i = i * } [email protected] Performance Management

Upload: abhigad

Post on 22-Apr-2015

378 views

Category:

Documents


2 download

DESCRIPTION

We will explore lessons learned in optimizing LOB Silverlight 4 application. This will be hands on session with focus on VS 2010 Performance Wizard, VMMap, SoS, HeapMonitor, etc.

TRANSCRIPT

Page 1: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Performance Management

Page 2: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

1. System.Console.WriteLine(int.MaxValue);//0 to 2147483647

2. Expensive Arithmetic Operations

3. A lot of work with no output / burning many Cpu Cycles for no reason

4. Look for stored procedure which will returnTrue/false value

5. Same output irrespective of inputs

6. Code duplication

observations

Page 3: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Line of business applications

1.lob does not focus on video games, compilers, scientific calculations, etc.

2. Mostly liner logic – do a , if b do c else do d 10 times and return results

3. 60-70% of the code will be if-else, for/foreach, switch, try/catch. Focused on projections ,transformations, filtering, crud, reporting, etc.

4. Focused on solving well defined problem with tight scope . For example, % of discount calculations based on zip code

5. A lot of immutable lookup / static data used as input in decision making logic. For example, zip code, cpt/icd codes, state list, ssn, etc.

6. Mutable data stored mostly in rdbms and shared via web services

Page 4: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

visual Studio 2010 Profiling Tools

If you don’t have VS 2010 premium - DownloadVS 2011 Developer preview Ultimate Edition- Its FREE

Page 5: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

demo...

Execution Bottlenecks

Page 6: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Keep your vsp file[s] under tight security

No additional code and solution is clean

Execution Bottlenecks

Page 7: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Method Description

Sampling Collects statistical data about the work done by an application.

Instrumentation Collects detailed timing information about each function call.

Concurrency Collects detailed information about multi-threaded applications.

.NET memoryCollects detailed information about .NET memory allocation and garbage collection.

Tier interactionCollects information about asynchronous ADO.NET function calls to a SqlServer database.

Microsoft Visual Studio Premium Profiling Tools provide five methods that you can use to collect performance data. This topic describes the different methods and suggests some scenarios in which collecting data with a particular method can be appropriate.

Execution Bottlenecks

Page 8: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Execution Bottlenecks

Page 9: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

memory Bottlenecks

Task Manager VM Map

Managed Memory

Native Memory

SoS

WinDbg

XPerf

Page 10: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Memory Bottlenecks

Heap: Native heap – objects your app is allocating

Managed heap : .NET heap – objects your app is allocating

Image : Modules you have loaded

Private data is virtual memory allocations

Page 11: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

memory Bottlenecks

Page 12: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

demo...

Execution Bottlenecks

Page 13: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Database Bottlenecks

SELECT [Extent1].[DocumentID] AS [DocumentID], [Extent1].[DocumentTitle] AS [DocumentTitle], [Extent1].[DocumentDescription] AS [DocumentDescription], [Extent1].[DocumentTypeID] AS [DocumentTypeID], [Extent1].[IsEnabled] AS [IsEnabled], [Extent1].[Author] AS [Author], [Extent1].[Category] AS [Category], [Extent1].[IsDeleted] AS [IsDeleted], [Extent1].[IsTemporary] AS [IsTemporary], [Extent1].[Gender] AS [Gender], [Extent1].[LowerAgeLimit] AS [LowerAgeLimit], [Extent1].[UpperAgeLimit] AS [UpperAgeLimit]FROM [dbo].[Document] AS [Extent1]

msec

Page 14: Performance Managment

while(i < int.MaxValue)                {                    i = i * 10;                }

[email protected]

Reference

Reference:

http://blogs.technet.com/b/markrussinovich/archive/2008/07/21/3092070.aspx

Silverlight Performance Blog : http://blogs.msdn.com/b/slperf/

If you have LOB application[s] that needs tuning – contact me. Deal is : I will use anonymous performance data with your permission in my research and you will get free service

I am @ Twitter: @Objectmapperblog: http://soaas.blogspot.comhttp://www.linkedin.com/pub/abhijit-gadkari/10/618/583