matlab-optimize-performance
Read BEFORE optimizing any MATLAB code for speed. Without this workflow, agents commonly optimize the wrong target, fabricate speedup claims without measurement, or introduce regressions. Guides the 7-step workflow: baseline, profile, identify, optimize, measure, verify, report.
npx skills add matlab/matlab-agentic-toolkit --skill matlab-optimize-performance --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.
# MATLAB Performance Optimization Workflow Systematic 7-step workflow for finding and fixing performance bottlenecks in MATLAB code. ## When to Use - User asks to speed up or optimize MATLAB code - User wants to find why their MATLAB code is slow - User has a function or script that takes too long to run - User asks to benchmark or time MATLAB code - User wants to compare performance before and after a change - User asks about MATLAB performance best practices ## When NOT to Use - Optimizing Simulink model simulation speed (use Simulink Profiler) - The bottleneck is in compiled C/MEX code that can't be changed at the M-code level - The performance issue is purely I/O-bound (file reads, network, database) - User wants to write performance *tests* (use the `writing-matlab-perf-tests` skill) ## The 7-Step Workflow ### Step 1: Establish Baseline Measure current performance so you have a number to improve against. **For a single function:** ```matlab f = @() targetFunction(input1, input2); baseline = timeit(f); fprintf('Baseline: %.4f s\n', baseline); ``` **For GPU code:** ```matlab f = @() gpuFunction(gpuInput); baseline = gputimeit(f); ``` **For a script or multi-step workflow:** ```m
- When to Use
- When NOT to Use
- The 7-Step Workflow
- Step 1: Establish Baseline
- Step 2: Profile and Analyze
- Step 3: Identify Optimization Opportunities
- Step 4: Implement Optimizations
- Step 5: Measure Optimized Performance
- Step 6: Verify Correctness
- Step 7: Report Results
- Key Rules
- Common Mistakes
- Reference Files
What does the matlab-optimize-performance skill do?
Read BEFORE optimizing any MATLAB code for speed. Without this workflow, agents commonly optimize the wrong target, fabricate speedup claims without measurement, or introduce regressions. Guides the 7-step workflow: baseline, profile, identify, optimize, measure, verify, report.
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-optimize-performance --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.
