matlab-write-performance-tests
Writes 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.
npx skills add matlab/matlab-agentic-toolkit --skill matlab-write-performance-tests --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Writing MATLAB Performance Tests 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. ## When to Use - User wants to write repeatable performance tests for their MATLAB code - User needs to benchmark functions with statistical confidence - User wants to detect performance regressions over time - User is setting up continuous performance monitoring - User asks how to use `runperf` or `matlab.perftest.TestCase` ## When NOT to Use - User wants a quick one-off timing (use `timeit` instead — see `matlab-optimize-performance`) - User wants to optimize existing code (use `matlab-optimize-performance`) - User wants to measure memory usage (use `matlab-optimize-memory`) - User wants to profile code to find bottlenecks (use `matlab-optimize-performance`, Step 2) ## Framework: `matlab.perftest.TestCase` All performance tests subclass `matlab.perftest.TestCase` and use measurement boundaries to control what gets timed. ### Basic Template ```matlab classdef MyFeaturePerformanceTest < matlab.perftest.TestCase properties (MethodSetupParameter) D
- When to Use
- When NOT to Use
- Framework: matlab.perftest.TestCase
- Basic Template
- Running Performance Tests
- Measurement Boundaries
- 1. keepMeasuring — Needed when code is fast (<10ms)
- 2. startMeasuring/stopMeasuring — For precise control
- 3. No boundary — Entire method is measured
- Parameterization
- MethodSetupParameter — When setup uses the parameter
- TestParameter — When only test methods use the parameter
- Combining Both — Size in setup, algorithm in test
- Lean Setup — Critical Rule
What does the matlab-write-performance-tests skill do?
Writes 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.
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-write-performance-tests --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
