In computer science, particularly in the study of compilers, an optimization is a transformation of computer programs that, when applied to a computer program P, produces an equivalent program P' which is in some way more optimal (i.e. faster, less memory consumption, etc). More formally, equivalent is defined so that for all halting inputs to P, P' will produce the same outputs.