Overview [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Operating Guide for the Series 700 and 800
Overview
This chapter contains guidance on programming techniques which will help
you to develop efficient applications. The information in this chapter
only applies to programs compiled to native code not intermediate code.
The next section provides some guidance on determining when to use native
code instead of intermediate code.
Choosing Intermediate or Native Code
If you want to run your code within an unlinked environment, you can
choose whether you want the cob command to output intermediate or native
code. See Chapter 2 , COBOL System Interface for details of how you
can do this.
For maximum performance, process your programs to native code, as native
code programs usually execute more quickly than intermediate code
programs. However, there is a qualification to this. A program that is
I-O bound (that is, spends most of its time moving data to and from files
and devices rather than performing arithmetic on it) derives relatively
little benefit in speed from code generation. Only programs that are
processor bound (that is, spend most of their time operating on data
rather than transferring it) are likely to increase their run-time speed
significantly as a result of code generation.
Although in most instances native code gives better performance than
intermediate code, you should be aware that the native code version of a
program takes up more space than its intermediate code equivalent, as
intermediate code is very compact. You must thus ensure that you have
enough memory and disk space available to cope with the space overheads
of native code.
Native code cannot be animated, thus you must do all your testing on the
intermediate code versions of your programs.
If your program is divided into a main COBOL program and a number of
subprograms called from the main program, some of the programs can be
processed to intermediate code, others to native code. You can mix the
two quite freely.
MPE/iX 5.0 Documentation