There are many ways that an application can be configured in order to affect its performance, with the goal being to achieve the most optimized application at run time. By optimized, this usually means that the application executes more rapidly, or is capable of operating with less memory storage or using fewer resources, or that it draws less power from the CPU.
Generally, improvements in one of these elements can come at a cost to another - an application may be optimized to run quicker, but in doing so, may use more memory in the process. Carefully consider what you hope to achieve when optimizing your application, as it will affect the types of optimizations you will apply.
Often, the biggest effect on performance comes from having good algorithms or logic in your code, and using the correct data structures for those operations. Something as simple as ensuring that you use integer arithmetic (as opposed to floating point) can produce big gains in performance. The Optimizing COBOL Syntax and Optimizing PL/I Syntax sections demonstrate many good practices that will help you optimize your code.
Compilation is another area of an application that can be optimized. During the debug phase of your development, you are going to have certain diagnostics switched on, which will affect performance but are necessary to step through your code to debug it. When compiling your production version of the application, you will want to turn some, if not all, diagnostics off.
When compiling your production version, it is also important to think about the platforms you are targeting. For example, if you are designing an application that runs on as many platforms as possible, that may stop you from taking advantage of specific CPU features that aid optimization.
Regardless of the level of optimization that you are looking for, you should benchmark your applications during the testing/implementation phase, so that you have a set of results from an application performing at an acceptable level with which to compare when you experience performance problems during production. Benchmarking results should be clearly recorded, including the details of the environment in which the application was run (for example: platform, directives set, any specific memory strategy in place).