coder.perfCompare
Compare execution times of MATLAB code and code generated using multiple configuration objects
Since R2024b
Syntax
Description
compares the execution times of the MATLAB® functions specified by t
= coder.perfCompare(fcnName
,numOutputs
,runtimeArgs
)fcnName
with the generated MEX code.
Use runtimeArgs
to specify the run-time input arguments used to compare
the performance, and numOutputs
to
specify the number of output arguments.
By default,
coder.perfCompare
uses a MEX configuration object withIntegrityChecks
andResponsivenessChecks
properties set tofalse
.coder.perfCompare
compares the performance for multiple runs and returns the median of execution times.coder.perfCompare
function uses internal heuristics to determine the number of runs.coder.perfCompare
excludes the timing overhead incurred by the data transfer between MATLAB and generated code execution.
compares the execution times of MATLAB code and the code generated using configuration objects specified by
t
= coder.perfCompare(fcnName
,numOutputs
,runtimeArgs
,coderConfigs
)coderConfigs
. For build types lib
and
dll
, generated code is executed using software-in-the-loop (SIL) or
processor-in-the-loop (PIL) simulation, which requires an Embedded Coder® license.
specifies additional options using name-value arguments.t
= coder.perfCompare(___,Name=Value
)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Tips
To achieve consistent results, make sure no other compute-intensive processes are running on the machine where the MATLAB or the generated function is timed.
Version History
Introduced in R2024b