Adaptive optimization: Difference between revisions

Content deleted Content added
Addbot (talk | contribs)
m Bot: Migrating 3 interwiki links, now provided by Wikidata on d:q337048
The use of context switching is inappropriate in the context of procedure calls. It's not the right term. Removing sentence about moving code to L2 cache. That may happen, but its not the optimizer doing it.
Line 1:
{{primary sources|date=August 2012}}
{{ref improve|date=August 2012}}
'''Adaptive optimization''' is a technique in [[computer science]] that performs [[dynamic recompilation]] of portions of a [[computer program|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 [[contextthe switch]]ingcost 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 or moving error processing code to secondary cache.
 
==Examples==