SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Performance in the .NET world. A developer’s perspective,[object Object],Sorin Oboroceanu, Vlad Balan,[object Object],RomSoft, www.rms.ro,[object Object],Iaşi, May 4th 2010,[object Object]
Agenda,[object Object],String vs. StringBuilder,[object Object],Serialization,[object Object],Reading XML,[object Object],Garbage Collection,[object Object],JITing,[object Object],2,[object Object]
String vs. StringBuilder,[object Object],3,[object Object],DEMO,[object Object]
Our Demo APP,[object Object],Uses StackOverflow.com’s data,[object Object],Groups users by location,[object Object],Displays user locations in a chart,[object Object],Will work in a client/server architecture,[object Object],Has performance issues ,[object Object],4,[object Object]
Collections,[object Object],Groupping data,[object Object],List<T>,[object Object],LINQ to Objects,[object Object],Dictionary<T,V>,[object Object],5,[object Object],DEMO,[object Object]
Client-Server communication,[object Object],Retrieving all users on the client,[object Object],Grouping data,[object Object],List<T>,[object Object],LINQ to Objects,[object Object],Dictionary<T,V>,[object Object],6,[object Object],DEMO,[object Object]
Client-Server communication,[object Object],Grouping data on the server,[object Object],List<T>,[object Object],LINQ to Objects,[object Object],Dictionary<T,V>,[object Object],Retrieving only location-related data on the client,[object Object],7,[object Object],DEMO,[object Object]
Reading XML,[object Object],DataSet,[object Object],XmlReader,[object Object],LINQ to XML,[object Object],XmlDocument,[object Object],8,[object Object],DEMO,[object Object]
Garbage Collection,[object Object],Why memory matters,[object Object],Garbage Collector,[object Object],Common Memory Issues,[object Object],Diagnosing Memory Problems ,[object Object],9,[object Object]
Why memory matters,[object Object],Inefficient use of memory can impact,[object Object],Performance,[object Object],Stability,[object Object],Scalability,[object Object],Other Applications,[object Object],Hidden problems in code can cause,[object Object],Memory Leaks,[object Object],Excessive memory usage,[object Object],Unnecessary performance overhead,[object Object],10,[object Object]
GC – Small Object Heap (SOH),[object Object],11,[object Object],GC,[object Object],SmallObjectObjectA = new SmallObject(); ,[object Object],SmallObjectObjectB = new SmallObject(); ,[object Object],Global Objects,[object Object],Small Object  Heap,[object Object],Next Object Pointer,[object Object],ObjectE,[object Object],Next Object Pointer,[object Object],Stack,[object Object],ObjectD,[object Object],Static Objects,[object Object],Next Object Pointer,[object Object],ObjectC,[object Object],Next Object Pointer,[object Object],ObjectB,[object Object],ObjectB,[object Object],Next Object Pointer,[object Object],ObjectA,[object Object],ObjectA,[object Object],Root Reference,[object Object],Next Object Pointer,[object Object],Child Reference,[object Object]
GC- Gen2,[object Object],LargeObjectObjectD= new LargeObject(); ,[object Object],Global Objects,[object Object],Free space table,[object Object],Large Object  Heap,[object Object],425000,[object Object],16777216,[object Object],ObjectD,[object Object],5727400,[object Object],94208,[object Object],182272,[object Object],Free space,[object Object],Stack,[object Object],ObjectC,[object Object],ObjectC,[object Object],ObjectB,[object Object],Free space,[object Object],ObjectB,[object Object],ObjectA,[object Object],ObjectA,[object Object],12,[object Object],12,[object Object]
13,[object Object],GC - Gen 0,[object Object],GC - Gen 1,[object Object],GC - Gen 2,[object Object],Small Object  Heap,[object Object],Gen 0,[object Object],Next Object Pointer,[object Object],Global Objects,[object Object],ObjectD,[object Object],ObjectC,[object Object],Next Object Pointer,[object Object],Gen 1,[object Object],Static Objects,[object Object],Stack,[object Object],ObjectB,[object Object],Gen 2,[object Object],ObjectA,[object Object],Root Reference,[object Object]
GC – Minimizing Overhead,[object Object],public class Test: IDisposable{  ~Test()  {	Cleanup (false);   }  private void Cleanup(boolcodeDispose)  {      if (codeDispose)      {	// dispose managed resources        }	// clean up unmanaged resources   }  public void Dispose()  {	Cleanup (true); GC.SuppressFinalize(this);  } },[object Object],14,[object Object]
GC – Common Memory Issues,[object Object],Excessive RAM Footprint,[object Object],App allocates objects too early or for too long using more memory than needed,[object Object],Can affect other apps on the system,[object Object],Excessive Temporary Object allocation,[object Object],Garbage Collection runs more frequently,[object Object],Executing threads freeze during Garbage Collection,[object Object],Memory Leaks,[object Object],Overlooked root references keep objects alive (Collections, array, session state, delegates/events),[object Object],Incorrect or absent Finalization can cause resources leaks,[object Object],15,[object Object]
DEMO,[object Object],16,[object Object]
JITing,[object Object],17,[object Object],Console,[object Object],static void WriteLine();,[object Object],static void WriteLine(string);,[object Object],(remaining members),[object Object],Managed EXE,[object Object],static void Main(){,[object Object],Console.WriteLine(“Hello”);,[object Object],Console.WriteLine(“GoodBye”);,[object Object],},[object Object],JITCompiler,[object Object],JITCompiler,[object Object],MSCorEE.dll,[object Object],…,[object Object],JITCompiler function{,[object Object],Look up the called method in the metadata,[object Object],Get the IL for it from metadata,[object Object],Allocate memory,[object Object],Compile the IL into allocated memory,[object Object],Modify the method’s entry in the Type’s table so it points to allocated memory,[object Object],Jump to the native code contained inside the memory block.,[object Object],},[object Object],Native CPU instr.,[object Object]
JITing,[object Object],18,[object Object],Console,[object Object],static void WriteLine();,[object Object],static void WriteLine(string);,[object Object],(remaining members),[object Object],Managed EXE,[object Object],static void Main(){,[object Object],Console.WriteLine(“Hello”);,[object Object],Console.WriteLine(“GoodBye”);,[object Object],},[object Object],JITCompiler,[object Object],Native,[object Object],MSCorEE.dll,[object Object],…,[object Object],JITCompiler function{,[object Object],Lookup the called method in the metadata,[object Object],Get the IL for it from metadata,[object Object],Allocate memory,[object Object],Compile the IL into allocated memory,[object Object],Modify the method’s entry in the Type’s table so it points to allocated memory,[object Object],Jump to the native code contained inside the memory block.},[object Object],Native CPU instr.,[object Object]
DEMO,[object Object],19,[object Object]
Resources,[object Object],CLR via C# 3, Jeffrey Richter,[object Object],www.red-gate.com,[object Object],www.stackoverflow.com,[object Object],MSDN,[object Object],20,[object Object]
Q&A,[object Object],21,[object Object]
22,[object Object],Please fill the evaluation form,[object Object],Thank you very much!,[object Object],Sorin Oboroceanu, Vlad Balan,[object Object],RomSoft, www.rms.ro,[object Object],Iasi, May 4th 2010,[object Object]

Weitere ähnliche Inhalte

Ähnlich wie Performance In The .Net World

Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data accessgordonyorke
 
Java one 2010
Java one 2010Java one 2010
Java one 2010scdn
 
Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Darwin Biler
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-PresentationChuck Walker
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios
 
GemFire In Memory Data Grid
GemFire In Memory Data GridGemFire In Memory Data Grid
GemFire In Memory Data GridDmitry Buzdin
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)Montreal JUG
 
Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...
Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...
Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...Gilles Fedak
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeMarco Gralike
 
Software Engineering - RS4
Software Engineering - RS4Software Engineering - RS4
Software Engineering - RS4AtakanAral
 
Zend framework 03 - singleton factory data mapper caching logging
Zend framework 03 - singleton factory data mapper caching loggingZend framework 03 - singleton factory data mapper caching logging
Zend framework 03 - singleton factory data mapper caching loggingTricode (part of Dept)
 
The Best Way to Become an Android Developer Expert with Android Jetpack
The Best Way to Become an Android Developer Expert  with Android JetpackThe Best Way to Become an Android Developer Expert  with Android Jetpack
The Best Way to Become an Android Developer Expert with Android JetpackAhmad Arif Faizin
 
Intro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptIntro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptjasonsich
 
Backbone.js and friends
Backbone.js and friendsBackbone.js and friends
Backbone.js and friendsGood Robot
 
Easing offline web application development with GWT
Easing offline web application development with GWTEasing offline web application development with GWT
Easing offline web application development with GWTArnaud Tournier
 

Ähnlich wie Performance In The .Net World (20)

Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data access
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 
Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4
 
ORM JPA
ORM JPAORM JPA
ORM JPA
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-Presentation
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
 
GemFire In-Memory Data Grid
GemFire In-Memory Data GridGemFire In-Memory Data Grid
GemFire In-Memory Data Grid
 
GemFire In Memory Data Grid
GemFire In Memory Data GridGemFire In Memory Data Grid
GemFire In Memory Data Grid
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)
 
Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...
Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...
Active Data: Managing Data-Life Cycle on Heterogeneous Systems and Infrastruc...
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
 
Software Engineering - RS4
Software Engineering - RS4Software Engineering - RS4
Software Engineering - RS4
 
Zend framework 03 - singleton factory data mapper caching logging
Zend framework 03 - singleton factory data mapper caching loggingZend framework 03 - singleton factory data mapper caching logging
Zend framework 03 - singleton factory data mapper caching logging
 
The Best Way to Become an Android Developer Expert with Android Jetpack
The Best Way to Become an Android Developer Expert  with Android JetpackThe Best Way to Become an Android Developer Expert  with Android Jetpack
The Best Way to Become an Android Developer Expert with Android Jetpack
 
Intro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptIntro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScript
 
Flink internals web
Flink internals web Flink internals web
Flink internals web
 
Backbone.js and friends
Backbone.js and friendsBackbone.js and friends
Backbone.js and friends
 
Basic Hibernate Final
Basic Hibernate FinalBasic Hibernate Final
Basic Hibernate Final
 
Scope Stack Allocation
Scope Stack AllocationScope Stack Allocation
Scope Stack Allocation
 
Easing offline web application development with GWT
Easing offline web application development with GWTEasing offline web application development with GWT
Easing offline web application development with GWT
 

Performance In The .Net World

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.