MATLAB speed tuner
Give it slow code. Get the real slowdown found, fixed and measured, with no made-up speed claims.
MATLAB speed tuner is a free AI skill for the job "Test and fix code". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · BSD 2 Clause licence · Made by MathWorks · Level: advanced
Made by MathWorks. See the original on GitHub; we copied it as it is, with its licence.
What it does
Slow MATLAB code made faster by fixing the real bottleneck, with measured proof and no invented speed claims. You hand over slow code and get the cause, the fix and the numbers. The skill follows seven steps. It times a baseline, then runs the profiler and reads self-time and call counts per line to find where time goes. It checks whether the target is worth optimising before it touches anything. Common fixes include moving unchanging work out of loops, vectorising, preallocating and using the GPU where it helps. After each change it times the code again and checks that the result is unchanged. Claims of speedup come only from measurements. A short report covers what was tried and what worked.
You give it
- The slow code
- A way to run it with typical data
- Your target speed (optional)
- MATLAB release
You get
- Baseline timing
- Profiler findings
- Faster code
- Before and after numbers
- Proof results match
Use it when
- A loop takes minutes and you think it should take seconds.
- You are not sure which line in your code is the slow one.
- You want a speedup you can quote with real numbers.
- Your GPU code is not faster than the CPU version.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run MATLAB.