HP 3000 Manuals

Ch 6. Writing Efficient Programs [ HP FORTRAN 77/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Programmer's Guide

Chapter 6  Writing Efficient Programs 

Ideally, a program should compile quickly, run quickly, and use a minimal
amount of memory for code and data.

You can take steps to minimize both time and space used by a program;
however, you might have to trade one type of efficiency to achieve
another.  For example, on a machine with 32-bit words, your program might
run faster if 32-bit integers (INTEGER*4) are used, but will use twice as
much data space as using 16-bit integers.  It is up to you as to which of
the resources are most valuable in your programming environment and to
consider the trade-offs.  Avoid optimization techniques that decrease the
readability, clarity, portability, and maintainability of your program.


NOTE The development of an efficient algorithm is the most important step towards efficient coding. The improvement achieved by the source manipulation techniques described in this chapter may be minimal compared to improving the overall method of solving the task. Also, the suggestions in this chapter might reduce the readability of your program.
This chapter describes ways you can improve your program efficiency in these five areas: * Compile time * Run time * Code space * Data space * Operating system issues


MPE/iX 5.0 Documentation