Contenuto principale

Prestazioni

Profilazione del tempo di esecuzione, profilazione dell'utilizzo della memoria, codice ottimizzato

Quando si è pronti a generare il codice di produzione, per migliorare le prestazioni, utilizzare le opzioni di configurazione e le ottimizzazioni avanzate. È possibile utilizzare le opzioni e le ottimizzazioni descritte nella documentazione del prodotto MATLAB® Coder™. Con Embedded Coder®, è inoltre possibile utilizzare la profilazione del tempo di esecuzione e la profilazione dell'utilizzo della memoria per analizzare le prestazioni.

Utilizzare la profilazione del tempo di esecuzione per:

  • Verificare se il codice generato soddisfa i requisiti in tempo reale dell'hardware.

  • Determinare le sezioni di codice che richiedono miglioramenti in termini di prestazioni.

Il report sulle metriche statiche del codice include metriche relative a file, variabili globali e funzioni. Il report sulle metriche statiche del codice consente di determinare quali variabili globali e quali percorsi di chiamata alle funzioni incidono sulle prestazioni. Per determinare la quantità di memoria dello stack necessaria per eseguire il codice generato, è possibile utilizzare un'esecuzione Software-In-the-Loop (SIL) e Processor-In-the-Loop (PIL) che genera un profilo di utilizzo dello stack.

App

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

Funzioni

espandi tutto

instrumentCodeAdd instrumentation to generated code to perform execution time / memory usage profiling and analyze code coverage (Da 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) (Da 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)

Oggetti

espandi tutto

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

Argomenti

Profilazione del tempo di esecuzione

Profilazione dell'utilizzo della memoria

Velocità di esecuzione