optimizing performance using code profilers n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Optimizing Performance Using Code Profilers PowerPoint Presentation
Download Presentation
Optimizing Performance Using Code Profilers

Loading in 2 Seconds...

play fullscreen
1 / 14

Optimizing Performance Using Code Profilers - PowerPoint PPT Presentation


  • 120 Views
  • Uploaded on

Optimizing Performance Using Code Profilers. Phil Wolfe, MCSD, MCAD, MCDBA RAD .NET Architect Werner Enterprises. Agenda. Overview Why Profile Code Code Profilers Where to Profile How to Profile Windows Example Conclusion Resources. Overview. Profilers measure performance

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Optimizing Performance Using Code Profilers' - vida


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
optimizing performance using code profilers

Optimizing Performance Using Code Profilers

Phil Wolfe, MCSD, MCAD, MCDBA

RAD .NET Architect

Werner Enterprises

agenda
Agenda
  • Overview
  • Why Profile Code
  • Code Profilers
  • Where to Profile
  • How to Profile
  • Windows Example
  • Conclusion
  • Resources
overview
Overview
  • Profilers measure performance
  • Not a test suite
  • Compare to sphygnometer not stethoscope
  • Types of profilers:
    • Code – Watching lines of code
    • Memory – Watching memory use and management
    • Hardware – Comparing output to standard
why profile code
Why Profile Code
  • Developers don’t always write code in the most efficient way.
  • 4GL code doesn’t always translate down in the most efficient or expected way.
  • Frameworks are built to support many solutions not optimized for any specific one.
  • Like tuning a musical instrument.
code profilers
Code Profilers
  • Measure code performance by:
    • Counts (Hit Count)
      • Source Code Lines
      • Methods
      • Modules
    • Time
      • First hit vs. subsequent hits
      • Per method/parent/child(ren) in milli/micro-seconds
      • Time in application vs. time in .NET Framework
short list of code profilers
Short List of Code Profilers
  • ANTS 1.3 – www.red-gate.com
  • AQTime 4 – www.automatedqa.com
  • DevPartner Profiler Community Edition – www.compuware.com
  • NCover – ncover.sourceforge.net
  • NProf – nprof.sourceforge.net
phil s profiler picks
Phil’s Profiler Picks
  • AQTime 4 – AutomatedQA Corp.
    • Price: $599.99
    • Profiles: Windows, Web, Serviced Components, Services
    • Displays Source Code
    • Integrates with Visual Studio.NET or Standalone
    • Overall: best interface, easiest to use, most fully-featured, very customizable, and documented
phil s profiler picks1
Phil’s Profiler Picks
  • ANTS Profiler – Red Gate Software
    • Price: $295
    • Profiles: Windows, Web, & Serviced Component
    • Displays Source Code
    • Does not integrate with Visual Studio.NET
    • Can not profile Windows Service applications
phil s profiler picks2
Phil’s Profiler Picks
  • DevPartner Community - Compuware
    • Price: Free (Pro Ed. $1,700.00)
    • Profile: Windows, Web (Serviced Component & Windows Services with Pro Ed.)
    • Displays Source Code
    • Integrates with VS.NET
    • Needs Framework 1.0 to install (see resources)
where to profile
Where to Profile
  • Slow Calls
  • “Main” Logic
  • “Messy” Logic
  • Everything
  • New Operating Systems
  • New .NET Framework Versions
how to profile
How to Profile
  • Compile in debug
  • Use the profiler to launch the application
  • Get a baseline
  • Start changing code
  • Start experimenting with other settings
  • Read the tutorials
  • Keep in mind while profiling:
    • The code is compiled in debug
    • JIT happens the first method call
    • Other processes on the machine
windows example
Windows Example
  • Maze application – Dan Fontanesi, Mike Gold, http://www.gamespp.com/csharp/mazeSolverUsingMultipleThreads.html
  • Get a Baseline
  • Make modifications
  • Test performance
  • Examine MSIL
  • Make more modifications
  • And on and on…
conclusion
Conclusion
  • Performance TUNE your applications by enhancing code
  • More hardware is not always the answer
  • Develop baselines and expectations
  • Perform code reviews in conjunction with code profilers
  • Choose the right profiler. A free one may cost more time in the end.
resources
Resources
  • See Profilers Slide
  • DevPartner installation workaround: To avoid installing the .NET Framework v1.0 on machines that do not have it installed, copy a v1.0 mscorlib.dll file to <root drive>\<windows folder>\Microsoft.NET\Framework\v1.0.3705\mscorlib.dll