Performance
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.To determine the size of stack memory that is required to run generated code, you can run a software-in-the-loop (SIL) and processor-in-the-loop (PIL) execution that generates a stack usage profile.
Apps
Code Profile Analyzer | Analyze execution-time and stack usage profiles for generated code (Since R2023a) |
Functions
Objects
Topics
Execution Time Profiling
- 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. - View Execution Times
Open the code execution profiling report generated by a SIL or PIL execution. - Analyze Execution Time Data
Use line commands to analyze execution-time measurements from a SIL or PIL execution. - Investigate Execution-Time Issues Using PMU Metrics
Analyze code execution metrics from the Performance Monitoring Unit of the hardware.
Memory Usage Profiling
- Generating a Static Code Metrics Report for Code Generated from MATLAB Code
Create and explore an example static code metrics report. - Static Code Metrics
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. - Stack Usage Profiling for Code Generated From MATLAB Code
Determine size of stack memory that is required to run generated code. - Preserve Unused Class Properties in Generated C/C++ Code
Preserve unused class properties or structure fields in the generated C/C++ code.
Execution Speed
- 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 SIMD Code from MATLAB Functions for Intel Platforms
Improve the execution speed of the generated code using Intel® SSE and Intel AVX technology. - Generate SIMD Code from MATLAB Functions for Apple silicon Platforms
Improve the execution speed of the generated code for Apple silicon platforms using ARM® Neon technology.