Main Content

性能

执行时间探查、内存使用量探查、优化的代码

当您准备好生成生产代码时,为了提高性能,请使用配置选项和高级优化。您可以使用 MATLAB® Coder™ 产品文档中介绍的选项和优化。利用 Embedded Coder®,您还可以通过执行时间探查和内存使用量探查来分析性能。

通过执行时间探查可以:

  • 确定生成的代码是否满足硬件的实时要求。

  • 确定哪些代码节需要进行性能改进。

静态代码度量报告包含有关文件、全局变量和函数的各种度量。静态代码度量报告可帮助您确定哪些全局变量和函数调用路径会影响性能。要确定运行生成的代码所需的堆栈内存的大小,您可以运行软件在环 (SIL) 和处理器在环 (PIL) 执行来生成堆栈使用量探查。

App

代码探查分析器Analyze execution-time and stack usage profiles for generated code (自 R2023a 起)

函数

全部展开

instrumentCodeAdd instrumentation to generated code to perform execution time / memory usage profiling and analyze code coverage (自 R2023a 起)
ExecutionTimeInSecondsGet execution time in seconds for profiled section of code (MATLAB code generation)
ExecutionTimeInTicksGet execution times in timer ticks for profiled section of code (MATLAB code generation)
getCoderExecutionProfileExtract execution-time profile for code generated from MATLAB function (MATLAB code generation)
Name获取探查的代码节的名称(MATLAB 代码生成)
Number获取唯一标识探查的代码节的编号(MATLAB 代码生成)
NumCallsTotal number of calls to profiled code section (MATLAB code generation)
reportOpen code execution profiling report and specify display of time measurements (MATLAB code generation)
scheduleVisualize task scheduling (MATLAB code generation) (自 R2021b 起)
SectionsGet array of coder.profile.ExecutionTimeSection objects for profiled code sections (MATLAB code generation)
SelfTimeInTicksGet number of timer ticks recorded for profiled code section, excluding time spent in child functions (MATLAB code generation)
Time进行代码节执行时间测量的时间端(MATLAB 代码生成)
TimerTicksPerSecondGet and set number of timer ticks per second (MATLAB code generation)
TotalExecutionTimeInTicksGet total number of timer ticks recorded for profiled code section (MATLAB code generation)
TotalSelfTimeInTicksGet total number of timer ticks recorded for profiled code section, excluding time spent in child functions (MATLAB code generation)
TotalTurnaroundTimeInTicksGet total number of timer ticks between start and finish of the profiled code section over the entire execution. (MATLAB code generation)
TurnaroundTimeInTicksGet number of timer ticks between start and finish of the profiled code section (MATLAB code generation)
MaximumExecutionTimeCallNumGet the call number at which maximum number of timer ticks occurred (MATLAB code generation)
MaximumExecutionTimeInTicksGet maximum number of timer ticks for single invocation of profiled code section (MATLAB code generation)
MaximumSelfTimeCallNumGet the call number at which the maximum number of timer ticks occurred, excluding time spent in child functions (MATLAB code generation)
MaximumSelfTimeInTicksGet the maximum number of timer ticks recorded for profiled code section, excluding time spent in child functions (MATLAB code generation)
MaximumTurnaroundTimeCallNumGet call number for the code section invocation with the maximum number of timer ticks between the start and the finish (MATLAB code generation)
MaximumTurnaroundTimeInTicksGet maximum number of timer ticks between start and finish of a single invocation of profiled code section (MATLAB code generation)

对象

全部展开

coder.profile.StackDriverSpecify driver to obtain stack usage data from target hardware (自 R2022a 起)

主题

执行时间探查

内存使用量探查

执行速度