TNS/R Native Application Migration Guide

Developing a Migration Strategy
TNS/R Native Application Migration Guide523745-001
2-6
Tuning the Performance of Native Programs
Another strategy is to set the FIELDALIGN CSHARED2 and REFALIGNED 2 pragmas
or the FIELDALIGN SHARED2 and REFALIGNED 2 directives when you first start
migrating a program. Once the program has been migrated to native mode and runs
correctly, you can remove the pragmas or directives and recompile the program. You
can then resolve any problems caused by data misalignment.
The data alignment you select depends on whether data is shared. See Section 11,
Shared Data Migration Tasks, if data is shared between:
TNS programs and native programs
pTAL programs and native C or C++ programs
For more information on how the native compilers align data, see:
C/C++ Programmer’s Guide
pTAL Conversion Guide
Tuning the Performance of Native Programs
To get the maximum performance from a native program, make sure that your program
does not spend excessive time in compatibility traps caused by data misalignment.
Subsections:
Detecting Compatibility Traps on page 2-6
Eliminating Compatibility Traps on page 2-7
Detecting Compatibility Traps
Compatibility traps can be detected using the Measure PROCESS entity during a
representative run of your program. The PROCESS entity COMP-TRAP counter
contains the number of compatibility traps.
If you detect significant compatibility traps, use the XLTrace tool against the program
during another representative run. XLTrace reports the type of each compatibility trap
and the code address of where each trap occurred. Next, use the noft utility to map
the code address from XLTrace to the source code location in the program.
Measure and XLTrace run only in the Guardian environment. Use an OSS run gtacl
command to run them from the OSS environment.
Note. XLTrace is a Software Tool which is provided as is and the customer has full
responsibility for installation and support. HP might provide limited support of Software Tools
on an as available basis. Do not run XLTrace on a production system.