This section describes various aspects which should be taken into consideration when the Natural Optimizer Compiler is installed at your site. The information provided in this documentation helps you to make full use of the benefits offered by the Natural Optimizer Compiler.
This document covers the following topics:
The Natural nucleus optimizes simple arithmetic, assignment, and comparison statements by translating parts of them into machine code. All programs are optimized automatically in this way.
The following graphic illustrates how the Natural Optimizer Compiler generates machine code when a Natural object is compiled or executed:
The Natural Optimizer Compiler goes one step further than standard optimization. It compiles not only simple statements to machine code, but also complex statements and statement sequences.
The compiled code is further optimized as far as array range operations, field concatenation, and optimum base register assignment are concerned.
All statements (including arithmetic operations) optimized with the Natural Optimizer Compiler provide the same results as the same statements generated by standard Natural.
To activate the Natural
Optimizer Compiler (see the relevant section), use the macro
NTOPT
in the Natural parameter module, the dynamic profile parameter
OPT
, the
system command NOCOPT
, or the
OPTIONS
statement.
All programs that are cataloged (STOW
or
CATALOG
system command) with the Natural Optimizer Compiler activated are compiled to
machine code. This will also result in the object code size of the programs
being larger than usual, depending on how much of the program can be
optimized.
A program executed with the RUN
system
command is compiled to machine code if the Natural Optimizer Compiler is
activated with the system command NOCOPT
, the
macro NTOPT
or the OPTIONS
statement for all or part of the program.
To see if a program is suitable for compilation with the Natural
Optimizer Compiler, use the NOCSTAT
command
as described in the relevant section.
Note:
The dynamic recatalog feature (profile parameter
RECAT
set
to ON
) cannot be used with programs compiled to machine
code.
To execute programs that have been compiled with the Natural Optimizer Compiler, it is not necessary that the Natural Optimizer Compiler is installed.