Performance Managment

480 views

Published on

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.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
480
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • This will point you right at the point where bottleneck is – it could be very complex business logic or calculations that needs immediate attention
  • Performance Managment

    1. 1. Performance Management<br />while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Abhijit.Gadkari@Gmail.COM<br />
    2. 2. observations<br />while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />1. System.Console.WriteLine(int.MaxValue);<br /> //0 to 2147483647<br />2. Expensive Arithmetic Operations<br />3. A lot of work with no output / burning many Cpu<br />Cycles for no reason<br />4. Look for stored procedure which will return<br />True/false value<br />5. Same output irrespective of inputs<br />6. Code duplication<br />Abhijit.Gadkari@Gmail.COM<br />
    3. 3. Line of business applications <br />while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />1.lob does not focus on video games, compilers, scientific calculations, etc.<br />2. Mostly liner logic – do a , if b do c else do d 10 times and return results <br />3. 60-70% of the code will be if-else, for/foreach, switch, try/catch. <br />Focused on projections ,transformations, filtering, crud, reporting, etc.<br />4. Focused on solving well defined problem with tight scope . For example, % of discount calculations based on zip code<br />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.<br />6. Mutable data stored mostly in rdbms and shared via web services<br />Abhijit.Gadkari@Gmail.COM<br />
    4. 4. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />visual Studio 2010 Profiling Tools<br />If you don’t have VS 2010 premium - Download<br />VS 2011 Developer preview Ultimate Edition<br /><ul><li>Its FREE</li></ul>Abhijit.Gadkari@Gmail.COM<br />
    5. 5. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Execution Bottlenecks<br />demo...<br />Abhijit.Gadkari@Gmail.COM<br />
    6. 6. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Execution Bottlenecks<br />Keep your vsp file[s] under tight security<br />No additional code and solution is clean <br />Abhijit.Gadkari@Gmail.COM<br />
    7. 7. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Execution Bottlenecks<br />Microsoft Visual Studio Premium Profiling Tools provide five methods that <br />you can use to collect performance data. This topic describes the different methods <br />and suggests some scenarios in which collecting data with a particular method can be <br />appropriate.<br />Abhijit.Gadkari@Gmail.COM<br />
    8. 8. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Execution Bottlenecks<br />Abhijit.Gadkari@Gmail.COM<br />
    9. 9. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />memory Bottlenecks<br />XPerf<br />Native Memory<br />Task Manager <br />SoS<br />VM Map<br />Managed Memory<br />WinDbg<br />Abhijit.Gadkari@Gmail.COM<br />
    10. 10. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Memory Bottlenecks<br />Heap: Native heap – objects your app is allocating<br />Managed heap : .NET heap – objects your app is allocating<br />Image : Modules you have loaded<br />Private data is virtual memory allocations<br />Abhijit.Gadkari@Gmail.COM<br />
    11. 11. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />memory Bottlenecks<br />Abhijit.Gadkari@Gmail.COM<br />
    12. 12. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Execution Bottlenecks<br />demo...<br />Abhijit.Gadkari@Gmail.COM<br />
    13. 13. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Database Bottlenecks<br />msec<br />SELECT <br />[Extent1].[DocumentID] AS [DocumentID], <br />[Extent1].[DocumentTitle] AS [DocumentTitle], <br />[Extent1].[DocumentDescription] AS [DocumentDescription], <br />[Extent1].[DocumentTypeID] AS [DocumentTypeID], <br />[Extent1].[IsEnabled] AS [IsEnabled], <br />[Extent1].[Author] AS [Author], <br />[Extent1].[Category] AS [Category], <br />[Extent1].[IsDeleted] AS [IsDeleted], <br />[Extent1].[IsTemporary] AS [IsTemporary], <br />[Extent1].[Gender] AS [Gender], <br />[Extent1].[LowerAgeLimit] AS [LowerAgeLimit], <br />[Extent1].[UpperAgeLimit] AS [UpperAgeLimit]<br />FROM [dbo].[Document] AS [Extent1]<br />Abhijit.Gadkari@Gmail.COM<br />
    14. 14. while(i < int.MaxValue)<br />                {<br />                    i = i * 10;<br />                }<br />Reference<br />Reference:<br />http://blogs.technet.com/b/markrussinovich/archive/2008/07/21/3092070.aspx<br />Silverlight Performance Blog : http://blogs.msdn.com/b/slperf/<br />I am @ <br />Twitter: @Objectmapper<br />blog: http://soaas.blogspot.com<br />http://www.linkedin.com/pub/abhijit-gadkari/10/618/583<br />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<br />Abhijit.Gadkari@Gmail.COM<br />

    ×