Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Profiling in .net

    • 0
    • 3
    • 4
    • 1
    • 0
    • 0
    • 0
    • 0
    • 396
    Comment on it

    Introduction

    In this section we will talk about three things: what to profile, why we need profiler and how can we profile our code. So we will discuss this one by one.

    Profiling collect the information about an application, that helps you to determine improvements that are required in your application. Profiler helps us to discover memory leaks, isolate performance bottlenecks, excessive memory usage, and find hyperactive and loitering objects.Profiling can have a massive benefit in performance and scalability of an application.

    What to profile

    An important part of application development is testing. A good testing make sure that, your application not only executes without errors, but also executes efficiently and responsively. Profiling tools and techniques helps you to build testing process, evaluate your code for constructions and to find errors that are likely to cause problems. You get an automated heads-up that points you directly at the places in your app that need refactoring. Profiler concentrates on the profiling of memory and performance in your application.

    Why we need profiler

    1. Profiling your code to ensuring your application performs as expected.
    2. To identify memory leaks in your application. Profiling your .NET code allows you to identify any unnecessary memory usage in your application.
    3. To identify unnecessary allocations of memory. This cost is deceptive, however, as there are more costs later when the GC needs to clean up. The more allocations a program does, the higher the GC costs will be. These GC costs are often negligible to the programs performance profile, but for certain kinds of apps, especially those on servers that require high-throughput operation, these costs can add up quickly and make a noticeable impact to the performance of the application.
    4. To focus the portion of .NET code that really requires attention. Profiling your application will pinpoint .NET code sections that really require improvement or tuning.
    5. To identify code blocks with performance issues. Performance is a very hard thing to measure and trace. Profiling your .NET code helps you to identify those code lines, blocks or methods that require performance improvement.
    6. To compare alternative approaches during your development. For any given task you might have two different implementations that you wish to compare, in order to find out which implementation is better in terms of performance, scalability, and resource usage. Thus you can select the most efficient code block.
    7. To get minimum execution and response times.
    8. To visualize performance and memory usage (Avoid guessing). A visual depiction for your application helps you to make informative decisions very quickly.
    9. To Track the lifecycle of your .NET object.

    How can we profile our code

    In above section we have looked at some reasons to consider profiling. To profile your code we have couple of the basic, free tools that allow you to profile your .NET code. CLR Profiler, PerfMon (Performance Monitor), JetBrains dotTrace , EQATEC profiler and Redgate ANTS are most commonly used tools.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: