Show TOC

Determining Runtime with the Hit ListLocate this document in the navigation structure

Prerequisites

You have created an ABAP trace of your ABAP program. The ABAP trace has the state Finished.

Context

Here is how to find out the total runtime of a traced program.

Procedure

  1. Open the Hit List, for example, by selecting a trace in the ABAP Traces view and selecting Show Hit List from the context menu.
    The Hit List opens in a new view of its own.
  2. The Hit List starts with the list of trace events sorted by Own Time. Re-sort the list by clicking on the Total Time [µs] column. This sorts the trace events by total runtime spent in a particular trace event.

    Total runtime includes time spent waiting while other trace events were called and processed. For that reason, Own Time (time spent processing the trace event itself) is often less than Total Time.

    The display looks something like this:

  3. Search for the start of the trace records of your program.

    As you can see in the screen shot above, the first six trace entries have to do with the ABAP Trace itself or with the communications infrastructure of the ADT. The third line, for example, shows that the total round-trip time of the ADT request was around 149 milliseconds. The total run time of our traced application (CL_DOCU_ATC_ADT_RES_ITF_DOCU->GET) appears in the last line shown in the screen shot. As you can see, the run time of the GET request was about 143 milliseconds.

    (By the way, the ABAP Trace uses kernel technology and is very fast. A traced application may slow down if the ABAP Trace needs to write a lot of trace records, but even in this case, the traced runtimes reflect only the activity of the traced program. The ABAP Trace automatically excludes its own runtime for making measurements and writing trace entries from the runtimes of the traced program and mot the tracing).

    Usually, you must read down the Hit List to find the start of the runtime that pertains to your code; the first entries pertain to the ADT or the communication infrastructure. You can identify the start of your code by looking at the Called Program column. You can also use the Filter column to restrict the display to your own code or to find particular procedures or other trace events.

  4. Evaluate the run time.

    Is the total runtime acceptable? In this case, the runtime of 143 milliseconds for fetching and displaying a document is probably acceptable. The response time for the user is likely to be far under 0,5 seconds. If the GET method had shown a higher runtime, close to 500 milliseconds, for example, then that would have been good cause to start analyzing the code to find out where the runtime is being consumed. A major refactoring and optimization might be required.

    It is useful to repeat your trace on different systems and on production systems under more realistic load conditions than you would find on a development or integration system. Screening your programs on a development or integration system remains, however, a good idea. An unacceptable runtime on your development system provides an early signal that optimization is needed.

  5. Analyze the code.

    Should you need to start a closer analysis of the code or set a break point in the code, just double-click on an entry in the Hit List. The ABAP editor opens in a separate view, positioned where the trace event occurred. If the trace event was aggregated, then the Search view opens to let you open the editor from one of the aggregated instances of the trace event.

    You can also use these context menu functions to navigate from hit list entries:

    How much time does my program need to run? Does it run as quickly as I expect it to? Is the runtime acceptable? You can answer these important questions with the Hit List.