Hauptinhalt

Leistung

Profilieren der Ausführungszeit, Profilieren der Speicherauslastung, optimierter Code

Wenn Sie bereit sind, Produktionscode zu generieren, können Sie Konfigurationsoptionen und erweiterte Optimierungen nutzen, um die Leistung zu verbessern. Sie können die in der Produktdokumentation von MATLAB® Coder™ beschriebenen Optionen und Optimierungen verwenden. Mit Embedded Coder® können Sie die Leistung zudem mithilfe von Ausführungszeit-Profilierung und Speicherauslastungsprofilierung analysieren.

Mit der Profilierung der Ausführungszeit können Sie:

  • Ermitteln, ob der generierte Code die Echtzeitanforderungen Ihrer Hardware erfüllt.

  • Herausfinden, bei welchen Codeabschnitten Leistungsverbesserungen erforderlich sind.

Die statischen Codemetrik-Berichte umfassen Metriken zu Dateien, globalen Variablen und Funktionen. Mit dem statischen Codemetrik-Bericht können Sie ermitteln, welche globalen Variablen und Funktions-Aufrufspfade sich auf die Leistung auswirken. Um die Größe des Stack-Speichers zu ermitteln, der zur Ausführung des generierten Codes erforderlich ist, können Sie eine Software-in-the-Loop- (SIL) und Processor-in-the-Loop-Ausführung (PIL) ausführen, die ein Stack-Auslastungsprofil ausgibt.

Apps

Code Profile AnalyzerAnalyze execution-time and stack usage profiles for generated code (Seit R2023a)

Funktionen

alle erweitern

instrumentCodeAdd instrumentation to generated code to perform execution time / memory usage profiling and analyze code coverage (Seit 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)
NameGet name of profiled code section (MATLAB code generation)
NumberGet number that uniquely identifies profiled code section (MATLAB code generation)
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) (Seit 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)
TimeTime over which code section execution time measurements are made (MATLAB code generation)
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)

Objekte

alle erweitern

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

Themen

Ausführungszeit-Profilierung

Speicherauslastungsprofilierung

Ausführungsgeschwindigkeit