Profiler utility for helping to improve performance


This article describes how to use the ACUCOBOL-GT built-in Profiler to identify processing times of specific program paragraphs so that you can determine if code changes would improve performance in your batch applications.


You have a batch application that currently takes a certain amount of time to complete. You want to determine if there are any coding changes you could make that would significantly reduce the program's processing time.


Use the Profiler to create a report that shows the processing time being spent on each paragraph in your program. Examine those paragraphs where the most time is spent to determine if coding changes could reduce processing times. The Profiler is available in version 7.0.0 or higher of the ACUCOBOL-GT runtime. To use the Profiler, follow these simple steps:

  1. Compile programs with debugging symbols.
    UNIX Example Windows Example
    ccbl -gy test.cbl
    ccbl32 -gy test.cbl 
  2. Use runtime switch "-p", which initiates the Profiler:
    UNIX Example Windows Example
    runcbl -p test.acu
    wrun32 -p test.acu

    This results in a file called acumon1.xml being created in the program's directory.

  3. Rename acumon1.xml to acumon.xml.
  4. Run the acuprof reporting module from the folder containing acumon.xml:
    UNIX Example Windows Example
    runcbl $ACUCOBOL/tools/acuprof.acu
    wrun32 �UCOBOL%\tools\acuprof.acu

    This results in a file called acumon.rpt being created in the program's directory.

  5. Review the profiler report:
    UNIX Example Windows Example
    cat acumon.rpt
    notepad acumon.rpt

Report Example:

ACUCOBOL-GT version 7.2.0
Timer interval = 10.029 milliseconds
Profile run on Fri Jul 07 12:11:09 2006, sorted by time
Total user time = 8.010 seconds, system time = 0.046 seconds
Pct Secs Count I/O Program
36.7% 8.35 57927 0 PDM0425
32.8% 7.47 1 38950 TRP140
15.2% 3.46 41947 0 TRA050A
14.2% 3.24 57927 0 TRS130B
0.7% 0.15 2 8 PCM1800
0.3% 0.07 14 15 TRZCG01B
0.0% 0.00 1 0 PCM1520

Tip: If the Timer interval is less than10.000 the results are not useful because your program has been executing for too short a time. We recommend an execution time of 10 seconds or more for the whole chain of programs. This is the reason we do not recommend the use of this module for TP applications, but only for batch applications.

Program results Example:

Opens: 1
Reads: 38949
Pct Secs Count Total Paragraph
52.1% 3.89 41947 17.1% Z70-CALL-TRA050A
40.5% 3.03 38949 13.3% Z10-READ-FTR013A
5.6% 0.42 38948 1.9% B20-PROCESS-ECR
0.5% 0.04 2996 0.2% B20-PROCESS-EO
0.4% 0.03 14 0.1% Z40-CALL-TRZCG01B
0.3% 0.02 1 0.1% A00-MAINLINE
0.3% 0.02 1 0.1% A10-DEBUT-PROG
0.3% 0.02 0 0.1% Z99-END

Here you can see that the application expends most time on paragraphs Z70-CALL-TRA050A and Z10-READ-FTR013A. You would then examine the code in those paragraphs to see if you can improve upon the logic.

If the code is very big you can divide the paragraph and rerun everything, this way you will be able to see more clearly which part of the paragraph is the one that is using most of the time.

Old KB# 14128
Comment List