Program optimization: Difference between revisions

Content deleted Content added
m Reverted edits by 78.173.47.193 (talk) (HG) (3.4.10)
Line 47:
 
===Run time===
[[Just-in-time compilation|Just-in-time]] compilers can produce customized machine code based on run-time data, at the cost of compilation overhead. This technique dates to the earliest [[regular expression]] engines, and has become widespread with Java HotSpot and V8 for JavaScript. In some cases [[adaptive optimization]] may be able to perform [[Runrun time (program lifecycle phase)|run time]] optimization exceeding the capability of static compilers by dynamically adjusting parameters according to the actual input or other factors.
 
[[Profile-guided optimization]] is an ahead-of-time (AOT) compilation optimization technique based on run time profiles, and is similar to a static "average case" analog of the dynamic technique of adaptive optimization.
Line 53:
[[Self-modifying code]] can alter itself in response to run time conditions in order to optimize code; this was more common in assembly language programs.
 
Some [[CPU design]]s can perform some optimizations at run time. Some examples include [[Outout-of-order execution]], [[Speculativespeculative execution]], [[Instructioninstruction pipeline]]s, and [[Branchbranch predictor]]s. Compilers can help the program take advantage of these CPU features, for example through [[instruction scheduling]].
 
===Platform dependent and independent optimizations===