Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes MATLAB performance tests as matlab.perftest.TestCase subclasses with statistically rigorous timing via runperf.
Use this skill ↓68% 86%+18 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 15 of 22 without it.
I need to choose test target durations for different levels of performance testing in MATLAB. What is the target duration per test point for unit/system performance tests versus application-level workflow benchmarks?
Targets total execution duration between 0.5 and 5 seconds for workflow benchmarks.
3 of 3 safety checks passed
Write performance tests for MATLAB code using the matlab.perftest.TestCase framework. This framework provides statistically rigorous timing with automatic warmup, multiple samples, and outlier handling.
runperf or matlab.perftest.TestCasetimeit instead — see matlab-optimize-performance)matlab-optimize-performance)matlab-optimize-memory)matlab-optimize-performance, Step 2)matlab.perftest.TestCaseAll performance tests subclass matlab.perftest.TestCase and use measurement boundaries to control what gets timed.
classdef MyFeaturePerformanceTest < matlab.perftest.TestCase
properties (MethodSetupParameter)
DataSize = struct('Small', 100, 'Medium', 1000, 'Large', 10000)
end
properties
inputData
end
methods (TestMethodSetup)
function setupData(testCase, DataSize)
% ALL setup outside the measurement boundary
testCase.inputData = randn(DataSize, 1);
Next to this one in the catalogue, plus more from the same author.