HGPR
- Default
- HGPR(PRESERVE)
- Recommended
- HGPR(NOPRESERVE)
- Reasoning
Better performance as no code has to be generated to save on entry and restore on exit the high halves of the 64-bit GPRs. Using the recommended HGPR setting is particularly important to improve the performance of relatively small COBOL programs that are entered many times.
When HGPR(PRESERVE) is specified, the compiler cannot rely on the high halves of general purpose registers (GPRs) being preserved during calls. Instead, they must be saved in memory and subsequently restored. The performance impact is most weakened for small programs that are called many times.
The use of HGPR(NOPRESERVE) over HGPR(PRESERVE) reduces the overhead of a program call by
6%
at OPT(2). Note this was measured in an otherwise empty COBOL program to emphasize the performance cost of this option and would be less of an overall degradation in a more substantial callee program.
- Considerations
- The PRESERVE suboption is necessary only if the caller of the program is not Enterprise COBOL, Enterprise PL/I, or z/OS® XL C/C++ compiler-generated code.