Changes

488 bytes added ,  20:00, March 24, 2012
→‎Optimisation: explain where optimisation takes place
Line 36: Line 36:  
* '''smaller''': less memory usage may be important for embedded computers used within other devices.
 
* '''smaller''': less memory usage may be important for embedded computers used within other devices.
 
* '''low power''': less power consumption may be important for battery-powered computers (e.g. laptops).
 
* '''low power''': less power consumption may be important for battery-powered computers (e.g. laptops).
−
Note that it is often only possible to optimise for a single criterion, since such optimisation may well make other criteria worse; it has been accepted for decades that many programs have a space/time trade-off so that reducing space will increase time and vice versa.
+
Note that it is often only possible to optimise for a single criterion, since such optimisation may well make other criteria worse; it has been accepted for decades that many programs have a space/time trade-off so that reducing memory usage will increase execution time and vice versa.
 +
 
 +
The bulk of the machine-independent optimisation takes place after the intermediate code is generated, effectively by re-arranging and modifying this code. Some machine-dependent optimisation may take place during register allocation. The bulk of the machine-dependent optimisation takes place during the generation of assembly language; this often includes extensive peep-hole optimisation to replace a group of assembler instructions by some shorter or simpler group.
    
==References==
 
==References==
SkipCaptcha
265

edits