HP-UX Floating-Point Guide
Chapter 7 179
Performance Tuning
Inefficient Code
Use these options judiciously. They are costly from a performance
standpoint and also from a software engineering perspective because
they change the semantics of an entire module rather than altering
specific problem areas.
The optimization option +Oinitcheck performs initialization in a more
selective way that has less impact on the performance of your program.
Use this option in Fortran 90 programs. See the f90(1) or f77(1) man page
for details.
See “Static Variables” on page 190 for more information about static
data.
Writing Routines in Assembly Language
If you have compiled with all of the correct compiler options and you are
still not satisfied with the program’s performance, you may want to
examine the generated code to see exactly what is happening. To get an
expanded listing, specify the -S option. You can also code parts of your
program directly in assembly language. Assembly language is useful if
performance is critical and portability is not.
When deciding whether to write something in assembly language, keep
in mind that the HP 9000 compilers are highly optimizing. If the code
section is large, the compiler can probably generate code as good as or
better than an assembly language program. Good candidates for
assembly language are short, frequently called routines. However, using
the +Oinline compiler option may improve the performance of these
routines enough to make it unnecessary to rewrite them in assembly
language.