200 Using IBM Application Development Tools for z/OS and OS/390
5.1 Why does an application developer need a profiler?
We were recently asked by a reviewer of the Application Monitor documentation what an
application programmer would use something like this tool for. This short introduction is
intended to answer that question.
5.1.1 During application development
The most straightforward use of the profiler is in situations where your code is not meeting its
intended performance targets. A profiler can be used to determine which routines are used
the most, and what would benefit from examination for performance tuning.
The next obvious use for a profiler is for determining the location of a “supposedly” infinite
loop. A profiler such as Application Monitor can be used to actively monitor the application
while it is running and “drill down” through the list of modules to the assembler instruction or
the COBOL/PLI source line.
There is yet another use for a profiler during development. While programming an application,
a programmer often ends up using code developed by another developer. This can leave a
programmer dangerously lacking in information about the performance of the code. If two
implementations are possible, a profiler can be used to determine which one will perform best
— either by using it to compare both implementations, or more likely, by using it to look at the
performance of functions you will be using and determine which functions run faster.
5.1.2 During application test
Most application development projects have either stated or implied performance targets.
A regimen of performance test scenarios is especially common. The profiler tool can be used
to provide more information; for example, suppose that an application runs 25% slower. The
tool could be used to determine which part of the application has degraded or if it was an
overall degradation. Comparative reports could also be used to monitor changes in the
application’s performance.
5.1.3 During application service
If a customer reports a problem with performance, a profiler is the perfect tool to help the
service professional narrow down the cause and pinpoint the solution.
5.1.4 During application maintenance
It is a fact of modern development that the person who maintains a given application is not
necessarily the person who wrote it. It is also true that the performance characteristics of an
application can change during its service lifetime.
A profiler such as Application Monitor can help stop the performance loss that often occurs
during maintenance. In an ideal world the location of the hot spots and heavy loops in a given
application would be known and documented for all follow on developers. We rarely see such
an ideal world. An application programmer can use this tool to determine where the hot spots
or heavy loops are in the application. The information on where the performance bottleneck is
located can then be taken into consideration when putting in a fix. For example, the developer
could find out where the heavy loop is, and then do whatever is possible to avoid adding code
to that loop when fixing the problem.
Application Monitor could also be used after a tentative fix that seems to degrade
performance to help find the cause of that degradation.

Get Using IBM Application Development Tools for z/OS and OS/390 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.