Following is a list of ways in which to improve the performance and efficiency of your SAS/C application.
- If you use
str*/mem* functions be sure to include string.h . If you call these functions many times,
there is serious potential for a performance boost. Without it, you get normal function calls. With it, you get special
built-in function calls.
- Use compiler option
reqproto to force you to include all headers for functions.
- Create optimized code by using the
optimize compiler option.
- Look at using the
__inline keyword to replace a call to the function with the code for the function itself. This could result in a significant improvement. Note:
You must also use the optimize compiler option when using __inline .
- Reduce the number of calls to user functions or look into inlining code. (See above.)
- Efficient Programming Tips.
- Use runtime option
=usage to determine how STACK and HEAP storage is being used. Once this has been determined, changing initial allocation is a good
potential for improvement and could even be significant.
- The Inline Machine Code Interface enables
a C program to generate supervisor calls (SVCs), DIAGNOSE instructions and CMS SVC 202s, and miscellaneous assembler language instructions
that cannot normally be generated with a high-level language. This enables you to write more efficient code.
- Choosing the correct Linkage Run-Time Options can make a significant difference in the amount of function overhead, how fast the program executes, and how easy it is to debug. Note that
the linkage option
=inter is the default. |