Interpreting iStrobe performance profile for a CA Gen application
This section guides you through the process of analyzing a Performance Profile for a CA Gen application using iStrobe. For a description of analyzing a Performance Profile with Strobe, see Interpreting-Strobe-performance-profile-for-a-CA-Gen-application. Refer to the iStrobe online help for additional information about using iStrobe.
This section describes the following steps for interpreting the information in the Performance Profile:
- Verifying the measurement session information
- Choosing between the execution and wait reports
- Finding significant activity in a CA Gen application
- Identifying performance improvement opportunities.
Verifying the Measurement Session Information
The first step is to ensure that the Performance Profile you are about to examine is valid. Start iStrobe, open the list of available Performance Profiles, and click the name of the one associated with your application. iStrobe displays the Measurement Session Data report for this Performance Profile.
The Measurement Session Data report is the starting point for analyzing any Performance Profile. This report contains information about the measurement session associated with the measurement request you submitted. There are a number of fields on this report that you should look at to determine that the measurement session is valid, and to determine which reports in the Performance Profile you should analyze.
To verify that the measurement session was valid, look at the following areas and fields on the report:
In the top section of the report, ensure that the Program, Session start date, and Session start time are what you expect.
Ensure that the appropriate version of CA Gen appears in the Subsystems field.
The format of the Subsystems field varies, depending on the number of different CA Gen releases running in the measured address space. The Subsystems field identifies the release level used to generate the application running in the measured address space. The formats are as follows:Value in Subsystems field (followed by release number)
Release name
COOLGEN
COOL:Gen
ADVNTG_GEN
Advantage Gen
ALLFUSIONGEN
AllFusion Gen (CA Gen)
Note: The Subsystems ID ends with “+” when more than three releases are identified as running in the address space.
In iStrobe Measurement Session Data Report, the Subsystems field shows that there is one release of CA Gen running in the measured address space. The report additionally indicates that the Db2 Feature was invoked in conjunction with Strobe for CA Gen by also showing the name and release level of Db2 in the Subsystems field.
- In the Measurement Statistics section on the left side of the report, examine the Runtime margin of error and the CPU margin of error fields. A run-time margin of error of less than 2% usually reflects a reliable measurement. If you find that the Performance Profile you are creating has a run-time margin of error higher than 2%, increase the target sample size and measure the application again. However, a high CPU margin of error does not mean that the Performance Profile is invalid. Rather, it indicates that you should focus your analysis on the reports that detail run time.
Having verified that the Performance Profile is valid, the next step is to determine which reports in the Performance Profile to analyze.
Choosing between Execution and Wait Reports
You typically do not need to examine all of the reports in the Performance Profile. To determine whether to examine the CPU execution or wait reports in the Performance Profile, look at the values reported for the EXEC field (the percentage of time that one or more CPUs were active) and the Wait field in the Percent time section of the report. The values in these fields will determine whether you should focus on the execution reports or the wait reports.
For example, in the example in iStrobe Measurement Session Data Report, the Wait value of 90% indicates that trying to curtail wait time might yield the most significant performance improvements.
When the value for Wait is very high, examine the following wait-oriented reports to determine where the application is waiting:
- Resource Demand Distribution
- Wait Time by Module
- I/O Facility Usage
- Data Set Characteristics
- Attribution of Wait Time.
When focusing on CPU, you should examine the following CPU reports:
- Program CPU Usage
- Transaction CPU Usage
- Attribution of CPU Usage.
For more information about these reports, refer to the iStrobe online help.
Having verified that the Profile is valid, and having determined whether you will focus on wait or CPU for performance improvement opportunities, you open the report at the summary level, choose specific modules to examine, and then look at the details for those modules.
Analyzing Activity in a CA Gen Application
The central resource for analyzing performance information about your CA Gen application is the Activity by Action Diagram report. The Activity by Action Diagram report identifies the CPU use and wait time for each module generated by CA Gen and the action diagram names that correspond to each module or control section. As you examine the report, you can view additional detail about action diagrams, associated CA Gen and SQL statement text, and system services used by the application.
To view this report, on the Measurement Session Data report, find the Subsystems section near the middle of the report and click the report iconnext to the CA Gen subsystem data. The Activity by Action Diagram report appears. (Alternatively, you can go to the menu at the top of the report and click Reports, AllFusion Gen, and then Activity by Action Diagram.)
The module names in the left column of the report are the CA Gen load module names that were specified during the Packaging of the application on the workstation.
The arrow iconnext to a data item indicates that you can expand it to view additional detail, starting with a list of action diagrams associated with the load module and the percent of CPU and wait that each consumed. To view a list of statements associated with an action diagram and their resource use, click the arrow icon next to the section name.
To display the statement number and the activity (CPU or Wait time) associated with the statement on the iStrobe and Strobe reports, the Design dialog option Execute Statement Number must be set to ON (the default). If the Execute Statement Number option is set to OFF, Strobewill not obtain the statement number, and all activity is assigned to statement number zero.
To examine the activity for statement number 28 in greater detail, click on the arrow to the left of statement 28. iStrobe displays the detail level report for the statement.
The report always shows the CA Gen statement number and the percentage of CPU use associated with the statement. The report can also show other information, such as SQL statement numbers and COBOL statement numbers and text associated with this action diagram statement, depending on how you created the Profile. To learn how to ensure that your Performance Profile includes this information, see Controlling the Level of Detail in the Reports. The Performance Profile example shown here was created by including both a Cool:Gen map data set and a COBOL compiler listing.
To view information about a single data item, without any other information in the report, click the context icon. A small pop-up report appears, showing only that data item and its parents. Doing so can be helpful if, for example, a module is associated with many action diagrams, and viewing the action diagram in which you are interested requires that you scroll so far down the list that the module is no longer visible in the browser window.
At this point in your analysis, you may want to do the following:
- Examine the action diagram code associated with a particular CA Gen statement, as described in Identifying Performance Improvement Opportunities.
- Examine the SQL text associated with a particular statement, if SQL statement numbers are available and SQL statements seem to a significant source of resource use. See Examining How Action Diagrams Access Db2 Data.
Identifying Performance Improvement Opportunities
To identify potential opportunities for performance improvement, you need to look at not only the CA Gen statement text, but the actual action diagram code as well. In Viewing CA Gen Statement Detail, the text for statement 28 indicates that one or more customer records are being read. The next step is to view the action diagram code in the following figure and look at what is happening around statement number 28.
Action Diagram Code from a COBOL Compiler Listing
Looking at the code (Action Diagram Code from a COBOL Compiler Listing) around statement 28, notice that statement 25 is the beginning of a loop. This WHILE statement reads one or more customer records and eventually calls a CA Gen-supplied time function (CURRENT_TIMESTAMP) shown in statement 29, storing the result in the time_value field.
This action diagram populates a current time field on one of the data entry panels of the application. Each time a new customer record is created or updated, this time routine is invoked, consuming additional CPU time. This could become a performance problem when the use of this routine is high.
This represents a possible performance improvement opportunity: remove the call to the current time function from the loop.
The following figure shows a possible solution to this problem. You have moved the call to the current time routine outside of the WHILE loop. As shown in the example, the call is now made once (in statement 25) and the result is saved in the CA Gen-supplied local work view time_value, eliminating subsequent calls to the current time routine.
Action Diagram Code (Revised)
After you complete the changes to the action diagram and reinstall the application on the host, measure the application again to see the effect of the changes. Comparing the Measurement Session Data reports for both measurements, you can see a significant reduction in CPU session time, as well as an overall decrease in elapsed time.
Additional CA Gen Performance Profile Data
The example in the previous sections centered on the reports associated with CA Gen statements within action diagrams. However, you may also find significant performance improvement opportunities in the way that your application accesses and uses system service routines and in the way that it accesses Db2 data. iStrobe provides convenient ways to view this type of information, as described in the following sections.
Examining System Services Invoked by Action Diagrams
An arrow next to a CA Gen statement number indicates that this statement invoked a system service routine that used CPU time. Click the arrow to view details about the services invoked by the statement, in this case statement number 250.
The .IEFLIB pseudo-module indicates a service routine supplied with CA Gen.
When iStrobe underlines a report data item, for example TIRDAT2 in Services Invoked by a CA Gen Statement, you can click it to view online help that provides additional information and performance tips.
Examining How Action Diagrams Access Db2 Data
In addition to examining data specific to CA Gen action diagrams and statements, it can be helpful to examine any SQL statement text generated on behalf of a CA Gen statement. If there are SQL statements associated with a CA Gen statement, iStrobe displays the SQL statement number on the Activity by Action Diagram report, as shown in Viewing CA Gen Statement Detail. iStrobe also shows the line number of the statement called by the COBOL statement identified in the COBOL Statement Text column, as found in the Db2 precompiler listing.
To view the SQL statement text and the activity associated with the statement, click the SQL button above the statement number. iStrobe displays the SQL Statement Text report.
Examining this additional data can reveal performance improvement opportunities other than the ones uncovered by examining only the CA Gen statement text. Because the SQL statement numbers and the CPU activity associated with them are identified on the report, it is relatively easy to identify which SQL statements within an action diagram are consuming the most resources. You are then able to focus your attention on a few SQL statements out of possibly hundreds for a very large application.
For example, you may have identified a number of SQL statements that are consuming a relatively large amount of CPU time. By examining the text for these statements, you discover that they are all SELECT statements that have WHERE clauses requiring data from multiple tables, resulting in a JOIN operation. This operation can be quite expensive in terms of CPU time. With this information, you could then explore other coding alternatives that may offer a performance improvement. In this case, it may be possible to revise the views defined in the action diagram, eliminating the unnecessary JOINs.
Using the SQL Statement Analysis Reports
iStrobe can provide additional reports that help you reduce the resource use of your SQL calls. These SQL statement analysis reports display in the lower part of the SQL statement analysis window shown in SQL Statement Text Report. Choose the SQL statement analysis report from the menu at the top of the window.
- Explain identifies the Db2 access path for a measured SQL request.
- Translation correlates and reports access path explanations with relevant Db2 catalog information about database objects.
- Opportunities supplies specific recommendations for improving SQL statement efficiency using well-documented rules.
- Catalog Statistics displays the Db2 catalog statistics.
To obtain the SQL statement analysis reports, you must request them when creating the Performance Profile. See the Using-Strobe-to-measure-online-applications-and-batch-programs for details.
Examining System Services Invoked by Db2
An arrow next to an SQL statement number indicates that this statement invoked a system service routine that used CPU time. Click the arrow to view details about the services invoked by the statement.
For ideas about how to improve performance, review which services were invoked and be sure to look at the online help that iStrobe provides for underlined modules. For example, the help for the DSNIOSET module suggests that you try to reduce CPU usage by increasing the number of matching columns used in an index scan.
Using the CA Gen Online Hints
iStrobe’s online help includes an online book containing guidelines and suggestions for improving the performance of your CA Gen application. You may find this a useful reference to have while coding your programs. To access this information:
From the iStrobe main window, select Help, and then select
iStrobe
help.
- From the Help table of contents, select AllFusion Gen Hints. Click the plus sign (+) next to any book icon within AllFusion Gen Hints to view an expanded table of contents.