Skip to Content
Technical Articles

Eclipse ADT ABAP Profiling(performance analysis)

Performance analysis has always been a challenge. Analysing the Performance trace result is even a bigger challenge.

ABAP Profiler is the recommended tool going forward. Check the screenshot from the SAP itself.

ABAP Profiler is a powerful tool for analysing the runtime performance or to understand the flow of the code. But it can get really confusing with the different options to initiate the profiling, different tabs and columns to analyse the results.

  1. Which option to choose?
  2. What are the different tabs on the output?
  3. What are all those columns and what do they mean?

Yes, all these details are available in our fav help.sap.com. Here is a simplified version of the same.

 

ABAP Profiler views

ADT has provided two views for working with ABAP Profiler.

  1. ABAP Trace Requests to initiate the trace or view initiated trace requests.
  2. ABAP Traces to view the trace results.

 

Initiate Profiling

Trace request can be initiated in one of the below three ways

  1. ABAP Trace Requests view

    1. Open the ‘ABAP Trace Requests’ view.
      1. Open%20ABAP%20Trace%20Requests%20view
      2. ABAP%20Trace%20Request%20view
    2. From the context menu of the project choose ‘Create Trace Request’
      1. Create%20Trace%20Request%20context%20view
    3. Select the Type of Request, Object Type, Object Name, User(to restrict to a single user), ‘Title of the trace file’.
      1. Trace%20Request%20Popup
    4. On the next screen select the ‘Trace Parameters’ as required and click ‘Finish’.
      1. Trace%20Request%20Parameters
    5. The newly created ‘Trace Request’ is visible on ‘ABAP Trace Requests’ view along with the number of executions as well.
  2. ABAP Program

    1. From the ABAP Program choose ‘Profile -> Profile As -> ABAP Application’ or Ctrl+F9. As you can see below profiling ‘ABAP Unit Test’ is also possible.
      1. From%20the%20ABAP%20Program
  3. ABAP Debugger

    1. From ‘ABAP Trace Requests’ view create a request as before but select ‘Explicitly switch off and on’
      1. From%20Debugger
    2. Now you can switch on and off the Profiler while debugging from the ruler context menu.
      1. FromDebuggerOn
      2. FromDebuggerOff

Trace Configurations

Once initiated the Profile configuration for the ABAP object is saved in ‘Profile->Profile Configurations’. These configurations can be edited as well. This helps in running the ABAP object with the same configuration next time via ‘Profile -> Profile As -> ABAP Application’ or Ctrl+F9.

SAT Transaction

All trace requests initiated from the ADT can be viewed in good old SAT transaction. But ABAP Profiling provides a more detailed view of the results when compared to SAT.

Terminology

Before we deep dive into the results let’s get familiar with the basic terminology.

Let’s take the below ‘Example Analysis Program’ calling different methods of a class.

  1. Call Position: Refers to the number of direct callers of a method and the call position of the calling method. A method can be called from many positions from the same calling method or program.
    1. In the below example method M2 is called from 2 different call positions
      1. ZRAM_TEST_PROFILING->M1->M2 at line 17
      2. ZRAM_TEST_PROFILING->M3->M2 at line 25
    2. Method M1 is called from 3 positions
      1. ZRAM_TEST_PROFILING->M1 at line 33
      2. ZRAM_TEST_PROFILING->M1 at line 34
      3. ZRAM_TEST_PROFILING->M1 at line 36
  2. Call Stack: Is the list of names of methods called at run time from the beginning of a program until the execution of the current statement.
    1. In the below example method M2 is called from 3 different call stacks
      1. ZRAM_TEST_PROFILING->M1->M2 at line 34
      2. ZRAM_TEST_PROFILING->M3->M2 at line 35
      3. ZRAM_TEST_PROFILING->M1->M2 at line 36
  3. Unspecified statements: Any intrinsic processing that the method is performing other than calling other methods or initiating objects for calling other methods or database access.
  4. Specified statements: Any statements to initiate objects for calling other methods or select statements. Note that Specified statements does not include actual call to the other methods or the database access itself.

 

Example Analysis Program

Analysing performance trace results

Captured traces can be viewed on the ‘ABAP Traces’ view.

CapturedTraces

  1. Overview screen

    1. Open the Overview by double clicking the trace.
    2. Overview gives an Overall and percentage distribution of Runtime.
  2. Condensed Hit List

    1. Consolidated Hit List tab provides the unique called methods.
    2. Irrespective of the call position and call stack the called methods are specified only once in this tab.
    3. Let’s take the method M2 and describe the columns.
      1. Example: M2 method is called from the below call stacks in a loop twice.
        1. ZRAM_TEST_PROFILING->M1->M2 at line 34
        2. ZRAM_TEST_PROFILING->M3->M2 at line 35
        3. ZRAM_TEST_PROFILING->M1->M2 at line 36
    4. Executions: specifies the number of times a given method is called irrespective of the call position and call stack.
      1. Method M2 is executed 6 times irrespective of the call stacks.
    5. Stacks: specifies the number of different call stacks.
      1. Method M2 is called from 3 different call stacks.
    6. Callers: specifies the number of callers irrespective of the call stack.
      1. Method M2 is called by M1 and M3.
    7. Own Time(Specified and Unspecified in micro-seconds): Includes the time spent processing the intrinsic statements and statements to create objects to call other methods. Note that this does not include the time spent waiting for the other methods or select statements to finish.
      1. In our example program there are no other objects or select statements. So, both this and ‘Own Time’ are same.
    8. Own Time(micro-seconds): Only the time taken by intrinsic statements of the method excluding any statements to create objects to call other methods.
    9. Total Time(micro-seconds): Own Time + time taken by specified statements + time taken waiting for methods or select statements to finish.
      1. Method M3 took 17 micro-seconds totally for the 2 iterations. Out of which it took only 10 micro-seconds for the intrinsic statements and 7 seconds for specified(if any) and waiting for M2 method to finish.
    10. %s: The above 3 fields are again specified in percentages.
  3. Hit List

    1. Hit List tab provides the list of different call positions for each method.
      1. M2 method is specified twice once on the second row and on the last row because of the 2 call positions from caller methods M1 and M3.
        1. ZRAM_TEST_PROFILING->M1->M2 at line 17
        2. ZRAM_TEST_PROFILING->M3->M2 at line 25
    2. As the Hit List is based on the call position, Callers column is not specified in this tab.
    3. There is no difference in the column list between Hit List and Consolidated Hit List other than Own Time(Specified and Unspecified in micro-seconds) and Callers columns missing.
  4. Aggregated Call Tree

    1. Aggregated Call Tree tab provides the unique call stacks for each method.
    2. Let’s take the method M2 from the example program
      1. Example: M2 method is called from the below call stacks in a loop twice.
        1. ZRAM_TEST_PROFILING->M1->M2 at line 34
        2. ZRAM_TEST_PROFILING->M3->M2 at line 35
        3. ZRAM_TEST_PROFILING->M1->M2 at line 36
    3. Method M2 is called twice in each of the above call stacks totalling to 6 executions. But the Aggregated Call Tree specifies M2 only 3 times as it aggregated same call stack of M2 into a single call stack.
    4. Most of the columns are same as Hit List.
  5. Call Sequence

    1. Call Sequence tab provides the list of different call stacks and their sequence for each method.
    2. Let’s take the method M2 from the example program
      1. Example: M2 method is called from the below call stacks in a loop twice.
        1. ZRAM_TEST_PROFILING->M1->M2 at line 34
        2. ZRAM_TEST_PROFILING->M3->M2 at line 35
        3. ZRAM_TEST_PROFILING->M1->M2 at line 36
    3. Method M2 is called twice in each of the above call stacks totalling to 6 executions. So the Call sequence specified M2 6 times.
    4. Most of the columns are same as Hit List.
  6. Call Timeline

    1. Provides the graphical colour coded timeline of the runtime.
  7. Database Accesses

    1. Provides the SQL queries executed. In our example there are no SQL statements.

Tab summary

  1. Hit List tab provides the list of different call positions for each method.
  2. Consolidated Hit List tab provides the unique called methods.
  3. Call Sequence tab provides the list of different call stacks and their sequence for each method.
  4. Aggregated Call Tree tab provides the unique call stacks for each method.

Trace Parameters

With the basic understanding of different tabs on the results screen it is easy to understand the trace parameters. Let’s discuss some of the import options.

  1. Perform aggregated measurement?: Specifies the level of aggregation. Note that the file size increases as the level of detail increases.
  2. Which ABAP statements should be traced?: Only procedural or any specific custom events?
  3. When should the trace start?: We have already discussed this.

 

In this article, you learned

  1. Different ways of initiating ABAP Profiling from Eclipse ADT.
  2. Saving the ABAP Profile configurations.
  3. Terminology involved in analysing ABAP trace results.
  4. Analysing data in different tabs from the ABAP trace results.
  5. Working with trace parameters.

Further reading

  • You can get more information on this topic from the ABAP Profiler

 

Feel free to add comments or ask questions on the comments section below. Or as always you can ask a question on our friendly SAP ABAP community.

1 Comment
You must be Logged on to comment or reply to a post.