When you are ready to generate production code, to improve performance, use configuration options and advanced optimizations. You can use the options and optimizations described in the MATLAB® Coder™ product documentation. With Embedded Coder®, you can also use execution-time profiling and memory usage profiling to analyze performance.
Use execution-time profiling to:
Establish whether the generated code meets real-time requirements of your hardware.
Determine code sections that require performance improvements.
The static code metrics report includes metrics on files, global variables, and functions. The static code metrics report helps you to determine which global variables and function call paths affect performance.
Execution Time Profiling for SIL and PIL
Why measure execution times for code generated from entry-point functions.
Generate Execution Time Profile
Enable execution-time profiling for a software-in-the-loop (SIL) or processor-in-the-loop (PIL) execution.
Open the code execution profiling report generated by a SIL or PIL execution.
Use line commands to analyze execution-time measurements from a SIL or PIL execution.
Generating a Static Code Metrics Report for Code Generated from MATLAB Code
Create and explore an example static code metrics report.
The code generator performs static analysis of the generated C or C++ code and provides these metrics in the static code metrics report in the code generation report.
Simplify Multiply Operations for Array Indexing in Loops
Replace multiply operations with add operations in array indexing in loops in C/C++ code generated from MATLAB code.
Generate Code Containing Single Instruction Multiple Data for MATLAB Code
Improve the performance of generated code using target hardware supported intrinsic functions.