Tuning your program
When
a program is comprehensible, you can assess its performance. A program that has
a tangled control flow is difficult to understand and maintain. The tangled
control flow also inhibits the optimization of the code.
Therefore, before you try to improve the performance directly, you need to
assess certain aspects of your program:
- Examine the underlying algorithms for your program. For top performance, a
sound algorithm is essential. For example, a sophisticated algorithm for
sorting a million items can be hundreds of thousands times faster than a
simple algorithm.
- Look at the data structures. They should be appropriate for the algorithm.
When your program frequently accesses data, reduce the number of steps
needed to access the data wherever possible.
- After you have improved the algorithm and data structures, look at other
details of the COBOL source code that affect performance.
You can write programs that result in better generated code sequences and use
system services better. These areas affect program performance:
- Coding techniques. These include using a programming style that helps the
optimizer, choosing efficient data types, and handling tables efficiently.
- Optimization. You can optimize your code by using the OPTIMIZE
compiler option.
- Compiler options and USE FOR DEBUGGING ON ALL PROCEDURES. Certain
compiler options and language affect the efficiency of your program.
- Runtime environment. Carefully consider your choice of runtime options and
other runtime considerations that control how your compiled program runs.
- Running under CICS.
Convert instances of EXEC CICS LINK to CALL to improve
transaction response time.
related concepts
Optimization
related tasks
Using an optimal programming style
Choosing efficient data types
Handling tables efficiently
Optimizing your code
Choosing compiler features to enhance performance
related references
Performance-related compiler options
Runtime options
|