2.9.1 Optimizing Small Programs with KAP

Follow these guidelines to optimize small programs:

  1. Compile the program without KAP, with minimum compiler optimization and with all compiler run-time checks enabled. Note the execution time and verify the results. If the program fails at this step, there is little optimization you can do.

  2. If you have the time and you know what the program is supposed to do, you can try to isolate the incorrect code, correct it, and proceed. This action may not be feasible for handling problems in large programs, but it might work for isolated portability problems.

    If the problem code is isolated and runs without KAP optimization, you may be able to run KAP on the rest of the program and leave out any problematic sections.

    You can also refer to the section on KAP problems in this chapter. You may be able to diagnose and correct some problems, and then run KAP on your program successfully.

  3. If the program compiles with minimum compiler optimization enabled, turn on all optimization except inlining by invoking /optimize=4 .

  4. If step 2 succeeds and the results are correct, try the suggestions in Section 2.12 about additional performance improvement techniques.

    If step 2 fails, try reducing one optimization at a time (/roundoff=0 , /scalaropt=1 , /optimize=3 , and any compiler optimizations) until the program runs correctly. Use the /lo=k qualifier setting to create a listing of the KAP command-line qualifiers and settings.


Previous Page | Next Page | Contents | Index |
Command-Line Qualifiers