Program execution |
---|
General concepts |
Types of code |
Compilation strategies |
Notable runtimes |
|
Notable compilers & toolchains |
|
An optimizing compiler is a compiler designed to generate code that is optimized in aspects such as minimizing program execution time, memory usage, storage size, and power consumption.[1] Optimization is generally implemented as a sequence of optimizing transformations, algorithms that transform code to produce semantically equivalent code optimized for some aspect.
In practice, factors such as available memory and a programmer's willingness to wait for compilation, limit the optimizations a compiler might provide. Research indicates that some optimization problems are NP-complete, or even undecidable.[2] In general, optimization cannot produce optimal output, which is impossible in a general sense since optimizing for one aspect may degrade performance for another. Rather, optimizations are heuristic methods for improving resource usage in typical programs.[3]: 585