Execution Speed
The code generator increases the execution speed of the generated code where
                    possible by replacing global variables with local variables, removing data
                    copies, using the memset and memcpy
                    functions, and reducing the amount of memory for storing data. You can increase
                    the execution speed of the generated code by implementing compiler and processor
                    specific optimizations, specifying buffer reuse, and removing code you might not
                    need.
Topics
- Optimize Generated Code by Combining Multiple for ConstructsThe code generator uses data dependency analysis to combine forconstructs to reduce static code size and runtime branching.
- Configure Loop Unrolling ThresholdStarting at a default value of 5, the code generator begins to use a forloop instead of separate statements to assign values to the elements of a signal or parameter array.
- Eliminate Dead Code Paths in Generated CodeThe code generator eliminates dead (that is, unused) code paths from the generated code. 
- Floating-Point Multiplication to Handle a Net Slope CorrectionFor processors that support efficient multiplication, improve code efficiency by using floating-point multiplication to handle a net slope correction. 
- Inline Numeric Values of Block ParametersReduce global RAM usage by inlining the literal numeric values of block parameters. 
- Optimize Generated Code Using Fixed-Point Data with Simulink, Stateflow, and MATLABGenerate fixed-point code in Simulink®, Stateflow®, and MATLAB®. 
- Generate Target Optimizations Within Algorithm CodeCustomize generated algorithm code with target-specific optimizations. 
- Use Conditional Input Branch ExecutionFor Switch and Multiport Switch blocks, Simulink executes only blocks that compute the control input and the data input that the control input selects. 
- Optimize Generated Code for Complex SignalsThe code generator performs various optimizations on the structures that represent signals in the generated code. 
- Speed Up Linear Algebra in Code Generated from a MATLAB Function BlockGenerate LAPACK calls for certain linear algebra functions in a MATLAB function block. Specify LAPACK library to use. 
- Speed Up Matrix Operations in Code Generated from a MATLAB Function BlockGenerate BLAS calls for certain low-level matrix operations. Specify BLAS library to use. 
- Speed Up Fast Fourier Transforms in Code Generated from a MATLAB Function BlockGenerate FFTW library calls for fast Fourier transforms in a MATLAB Function block. Specify the FFTW library. 
- Synchronize Multithreaded FFTW Planning in Code Generated from a MATLAB Function BlockImplement FFT library callback class methods and provide supporting C code to prevent concurrent access to FFTW planning. 
- Control Memory Allocation for Variable-Size Arrays in a MATLAB Function BlockDisable dynamic memory allocation or specify a dynamic memory allocation threshold for MATLAB Function blocks. 
- Generate SIMD Code from Simulink Blocks for Intel PlatformsImprove the execution speed of the generated code using Intel® SSE and Intel AVX technology. 
- Optimize Code for Reduction Operations by Using SIMDGenerate optimized code for reduction operations using SIMD instruction sets.