OPT

Beginning with COBOL V5.1, the compiler offers multiple levels of optimization. Performance improves as the level of optimization is increased. There are several issues to consider before changing the OPTIMIZE(n) compiler option where (n) has a value of 0, 1 or 2.

  • Applications using user-written condition handlers are restricted to using OPT(0).

  • Complex/large programs may take too much memory or time to compile.

  • For developing and debugging code, use OPT(0) to avoid optimizing the code. Attempting to debug optimized code may cause unpredictable results with all code debuggers, including Xpediter.

  • For performance testing and for production, increase the optimization level using OPT(1) or OPT(2).