Optimization Methods

Adaptive Optomization

Adaptive optimization is a technique in computer science that performs dynamic recompilation of portions of a program based on the current execution profile. With a simple implementation, an adaptive optimizer may simply make a trade-off between just-in-time compilation and interpreting instructions. At another level, adaptive optimization may take advantage of local data conditions to optimize away branches and to use inline expansion to decrease the cost of procedure calls.
Consider a hypothetical banking application that handles transactions one after another. These transactions may be checks, deposits, and a large number of more obscure transactions. When the program executes, the actual data may consist of clearing tens of thousands of checks without processing a single deposit and without processing a single check with a fraudulent account number. An adaptive optimizer would compile assembly code to optimize for this common case. If the system then started processing tens of thousands of deposits instead, the adaptive optimizer would recompile the assembly code to optimize the new common case. This optimization may include inlining code.
Dynamic Recompilation:  dynamic recompilation is a feature by which the system may recompile some part of a program during execution. By compiling during execution, the system can tailor the generated code to reflect the program's run-time environment, and potentially produce more efficient code by exploiting information that is not available to a traditional static compiler.
Just-in-time Compilation: just-in-time (JIT) compilation, also known as dynamic translation, is compilation done during execution of a program – at run time – rather than prior to execution. Most often this consists of translation to machine code, which is then executed directly, but can also refer to translation to another format.

Dynamic Optimization


The basic intuition of dynamic optimization can be illustrated with a simple example of intertemporal allocation. Suppose you embark on a two-day hiking trip with w units of food. Your problem is to decide how much food to consume on the first day, and how much to save for the second day. It is conventional to label the first period 0. Therefore, let c0 denote consumption on the first day and c1 denote consumption on the second day. The optimization problem is max c0,c1 U(c0, c1) subject to c0 + c1 = w Clearly, optimality requires that daily consumption be arranged so as to equalize the marginal utility of consumption on the two days, that is Dc0U(c0, c1) = Dc1U(c0, c1) Otherwise, the intertemporal allocation of food could be rearranged so as to increase total utility. Put differently, optimality requires that consumption in each period be such that marginal benefit equals marginal cost, where the marginal cost of consumption in period 0 is the consumption foregone in period 1. This is the fundamental intuition of dynamic optimization - optimality requires that resources be allocated over time in such a way that there are no favorable opportunities for intertemporal trade.



Comments

Popular posts from this blog

python

mcqs on dsps

Mathematical Model