matlab/matlab-agentic-toolkit / skills-catalog/matlab-software-development/matlab-write-performance-tests
matlab-write-performance-tests
VerifiedWrites MATLAB performance tests using the matlab.perftest.TestCase framework. Use when asked to write, create, or add performance tests for MATLAB code, benchmark functions, measure execution time with statistical rigor, or use runperf.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.4 KB |
| manifest.yaml | config | 478 B |
| references/FeaturePerformanceTest.m | other | 2.3 KB |
| references/simulink-template.md | markdown | 1.5 KB |
| references/tExampleWorkflow.m | other | 1.6 KB |
references/simulink-template.md
View on GitHub# Simulink Model Performance Test Template
Use this template when benchmarking Simulink model operations (load, compile, simulate).
```matlab
classdef ModelPerformanceTest < matlab.perftest.TestCase
%ModelPerformanceTest Performance test for Simulink model
% Tests model load and simulation phases.
%
% Run with: results = runperf('ModelPerformanceTest');
properties (TestParameter)
ModelName = {'myModel_small', 'myModel_large'}
end
properties
loadedModel
end
methods (TestMethodTeardown)
function cleanupModel(testCase) %#ok<MANU>
bdclose('all');
end
end
methods (Test)
function testModelLoad(testCase, ModelName)
testCase.startMeasuring();
load_system(ModelName);
testCase.stopMeasuring();
testCase.verifyTrue(bdIsLoaded(ModelName));
end
function testModelSimulation(testCase, ModelName)
% Load outside measurement
load_system(ModelName);
testCase.startMeasuring();
sim(ModelName);
testCase.stopMeasuring();
end
end
end
```
## Notes
- Use `startMeasuring`/`stopMeasuring` to isolate specific phases (load vs compile vs simulate)
- Model load should be measured separately from simulation
- Close models in `TestMethodTeardown` to avoid state leakage between tests
- For meaningful results, ensure the phase of interest runs for at least a few seconds
Copyright 2026 The MathWorks, Inc.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |