.NET Performance Profiling

  • Overview

    Performance profiling is a process of investigating and analyzing a program’s runtime behavior to determine how to optimize the program’s performance. The data used for this analysis is collected while the program is being executed. Performance profiling of .NET applications helps developers evaluate and improve the performance characteristics of their software.

    Performance profiling helps the optimization of the application. Program analysis tools that examine the behavior of an application are classified as performance profilers. There are different types of performance profiler tools and they are grouped by their output. Event-based profilers are associated with .NET language. A .NET performance profiler is a powerful tool, packed with features that:

    • Identify which specific section of the .NET code (unit, line or block) or which method may need performance improvement
    • Facilitate the accurate estimation of execution times for .NET code
    • Visualize performance issues to help users better understand and address them

    Testing .NET applications does not simply mean ensuring that applications execute without errors. One of the major reasons behind performance profiling is to make your apps run faster when executed and still deliver value to the end-user. A .NET performance profiler provides in-depth information on how many times each method was called and how long it took. The evaluation of the code for any constructions and errors ensures that there are no performance bottlenecks which may slow down the execution of the .NET application.

    Thus, performance profiling is both a prevention and a resolution process. A .NET performance profiler can be used to get a baseline snapshot in the beginning of the development of an application. Then as the work on that project continues, more snapshots can be taken on a regular basis. At different stages of the development, those snapshots are compared with the baseline snapshot to keep track of how a particular feature impacts the performance of other features or the application itself. Therefore, instead of resolving performance issues and bottlenecks later on, you can prevent them before they even occur.

    In time, this page will be further expanded to enrich the topic and provide you with more information on performance profiling of different .NET applications. Meanwhile, you can subscribe to the Just* blog and follow us on Twitter.

  • Complete Protection for Your Apps with JustTrace

    JustTrace is a two-in-one .NET profiler that enables both memory and performance profiling of applications in any .NET language.

    JustTrace uses two different approaches for performance profiling. The Sampling profiler of JustTrace dumps the call stacks for all threads executed by the profiled application at regular intervals using operating system interrupts. While this approach may produce results with sub-optimal accuracy, the performance hit on the application being profiled is very minor and thus workflow is fast and uninterrupted. The Tracing Profiler collects CLR events when entering and leaving methods. The Tracing Profiler produces much more accurate results, but the hit on the performance is slightly bigger.

    The different snapshot views that JustTrace provides enable a visualization of critical performance metrics. Performance data is collected in real-time during the profiling session and can be examined either in a snapshot or in a Live Data view. The snapshots also aid the prevention of issues at an early stage of the development process by giving a basis for comparison of the effect that the addition of different features might have on performance.