SmartPascal
$Optimization
Compiler Directive
Determines whether Delphi optimises code when compiling
1   {$Optimization Off}
2   {$Optimization On}
Description
The $Optimization compiler directive determines whether Delphi compiles the current application with code optimization.
 
Code optimization makes for slightly more efficient code operation, and size.
 
Delphi does this in a way that preserves the logical integrity of the code, but which can confuse during debugging. This is especially true when Delphi creates no code for what it sees as redundant lines, such as variable assignment where the variable is then not used.
Notes
$Optimization is equivalent to $O.

The default value is $Optimization On
Related commands
$O Determines whether Delphi optimises code when compiling
 
Example code :