next up previous
Next: Include Files
Up: CHR Character Handling Routines
Previous: Compiling and Linking

Efficiency Considerations

Several routines provided by CHR have implications for the efficiency of applications which make heavy use of them. These routines when used judiciously present no efficiency problem, but when they are used indiscriminantly they can have a marked effect on execution times.

CHR_CTOx
These routines make use of the Fortran internal READ statements which can have an impact upon execution times when used heavily. Within an application it is only absolutely necessary to perform this type conversion once, when it is needed. If both representations are needed within an application, store both.
CHR_LEN
Checking the used length of a given CHARACTER argument within every subroutine can have a significant impact upon execution times and should be avoided. For character strings which are not modified, CHR_LEN need only be called once. The used length of the string may then be passed as an additional subroutine argument, e.g.
      STRLEN = CHR_LEN( STRING )
      CALL SUBN( STRING, STRLEN, STATUS )

or the substring that represents the filled part of the string may be passed to the subroutine, e.g.

      STRLEN = CHR_LEN( STRING )
      CALL SUBN( STRING( 1 : STRLEN ), STATUS )

CHR_xTOC
These routines make use of the Fortran internal WRITE statements which can have an impact upon execution times when used heavily. Within an application it is only absolutely necessary to perform this type conversion once, when it is needed. If both representations are needed within an application, store both.



next up previous
Next: Include Files
Up: CHR Character Handling Routines
Previous: Compiling and Linking



CHR Character Handling Routines
Starlink User Note 40
A C Charles
P C T Rees
A J Chipperfield
2 August 1995
E-mail:ussc@star.rl.ac.uk