Install any skill in seconds. Free to start, no credit card required.
Get Started Free →matlab/matlab-write-performance-tests
Writes MATLAB performance tests using the matlab.perftest.TestCase framework.
Passed 19 of 22 test cases with the skill, and 15 of 22 without it.
and 9 more in the full report
7 fixed12 passed either way0 still failing3 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am benchmarking a simple bitwise operations function `bitShiftAdd` in MATLAB that takes less than 1 millisecond. I want to time a single call directly in the test method without loops or framework flags. How should the test method be written to achieve statistically sound measurements for sub-10ms operations?
| Checked | Without skill | With skill |
|---|---|---|
| Uses a keepMeasuring loop boundary to repeatedly execute operations faster than 10 milliseconds. | Missed | Passed |
The instructions your model reads when the skill loads.
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);
test cases passed, vs 15 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.