User`s guide
6 Optimizing Performance
6-2
Optimization Bundles
All optimizations are controlled separately, and you can enable or disable any
of the optimizations. To simplify the process, you can use the provided bundles
of Compiler settings that allow you to select the most common optimization
options. For more information on bundles, see “-B
<filename>:[<a1>,<a2>,...,<an>] (Bundle of Compiler Settings)” on page 7-41.
Turn On All Optimizations
To turn on all optimizations, use
-O all
This bundle is stored in
<matlab>/toolbox/compiler/bundles/opt_bundle_all. By default, all
optimizations, except
speculate, are on unless you specifically disable them or
use the
-g option for debugging. The -g option disables all optimizations.
Turn Off All Optimizations
To turn off all optimizations, use
-O none
This bundle is stored in
<matlab>/toolbox/compiler/bundles/opt_bundle_none. This optimization
setting is used whenever you use
-g for debugging.
Turn On Individual Optimizations
You can enable or disable each individual optimization. To enable/disable an
optimization, use
-O <optimization option>:[on|off]
where <optimization option> is
•
array_indexing
• fold_mxarrays
• fold_non_scalar_mxarrays
• fold_scalar_mxarrays
• optimize_conditionals