性能
执行时间探查、内存使用量探查、优化的代码
当您准备好生成生产代码时,为了提高性能,请使用配置选项和高级优化。您可以使用 MATLAB® Coder™ 产品文档中介绍的选项和优化。利用 Embedded Coder®,您还可以通过执行时间探查和内存使用量探查来分析性能。
通过执行时间探查可以:
确定生成的代码是否满足硬件的实时要求。
确定哪些代码节需要进行性能改进。
静态代码指标报告包含有关文件、全局变量和函数的各种指标。静态代码指标报告可帮助您确定哪些全局变量和函数调用路径会影响性能。要确定运行生成的代码所需的堆栈内存的大小,您可以运行软件在环 (SIL) 和处理器在环 (PIL) 执行来生成堆栈使用情况探查。
函数
对象
主题
执行时间探查
- 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.
内存使用量探查
- 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. - Removal of Unused Class Properties in Generated C/C++ Code
Remove unused class properties or structure fields in the generated C/C++ code.
执行速度
- 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 for MATLAB Functions
Improve the execution speed of the generated code using Intel® SSE and Intel AVX technology.