[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75MJK1CVHCWT0SA6JE4VW6F":3,"skill-same:01M75MJK1CVHCWT0SA6JE4VW6F":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M75MJK1CVHCWT0SA6JE4VW6F","matlab-write-performance-tests",null,"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.","stanfish06\u002Fskillquarium","stanfish06","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93099613?v=4","01M75F1CK4ZW109ZK3T26VN52F","Zhiyuan","01M75F1CM53VH6F79DZ8GXKKES",12,"BSD-2-Clause","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-write-performance-tests\u002FLICENSE.md","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-write-performance-tests\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: matlab-write-performance-tests\ndescription: \"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.\"\nlicense: MathWorks BSD-3-Clause\nmetadata:\n  author: MathWorks\n  version: \"1.0\"\n---\n\n# Writing MATLAB Performance Tests\n\nWrite 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.\n\n## When to Use\n\n- User wants to write repeatable performance tests for their MATLAB code\n- User needs to benchmark functions with statistical confidence\n- User wants to detect performance regressions over time\n- User is setting up continuous performance monitoring\n- User asks how to use `runperf` or `matlab.perftest.TestCase`\n\n## When NOT to Use\n\n- User wants a quick one-off timing (use `timeit` instead — see `matlab-optimize-performance`)\n- User wants to optimize existing code (use `matlab-optimize-performance`)\n- User wants to measure memory usage (use `matlab-optimize-memory`)\n- User wants to profile code to find bottlenecks (use `matlab-optimize-performance`, Step 2)\n\n## Framework: `matlab.perftest.TestCase`\n\nAll performance tests subclass `matlab.perftest.TestCase` and use measurement boundaries to control what gets timed.\n\n### Basic Template\n\n```matlab\nclassdef MyFeaturePerformanceTest \u003C matlab.perftest.TestCase\n\n    properties (MethodSetupParameter)\n        DataSize = struct('Small', 100, 'Medium', 1000, 'Large', 10000)\n    end\n\n    properties\n        inputData\n    end\n\n    methods (TestMethodSetup)\n        function setupData(testCase, DataSize)\n            % ALL setup outside the measurement boundary\n            testCase.inputData = randn(DataSize, 1);\n        end\n    end\n\n    methods (Test)\n        function testMyFunction(testCase)\n            data = testCase.inputData;\n            while testCase.keepMeasuring\n                result = myFunction(data);\n            end\n            testCase.verifyNotEmpty(result);\n        end\n    end\nend\n```\n\n### Running Performance Tests\n\n```matlab\n% Run with statistical rigor (automatic sample size)\nresults = runperf('MyFeaturePerformanceTest');\n\n% View results\ndisp(results)\n\n% Fixed sample count (faster, less statistical power)\nimport matlab.perftest.TimeExperiment;\nsuite = testsuite('MyFeaturePerformanceTest');\nexperiment = TimeExperiment.withFixedSampleSize(4);\nresults = run(experiment, suite);\n```\n\n## Measurement Boundaries\n\nThe framework offers three ways to control what gets measured:\n\n### 1. `keepMeasuring` — Needed when code is fast (\u003C10ms)\n\nAutomatically loops the code until enough samples are collected. Required for sub-10ms operations to achieve statistical rigor; works at any speed but adds overhead for slower code where `startMeasuring`\u002F`stopMeasuring` is preferred:\n\n```matlab\nfunction testFastFunction(testCase)\n    data = testCase.inputData;\n    while testCase.keepMeasuring\n        result = fastFunction(data);\n    end\n    testCase.verifyNotEmpty(result);\nend\n```\n\n### 2. `startMeasuring`\u002F`stopMeasuring` — For precise control\n\nUse when you need setup between iterations or want to exclude specific code:\n\n```matlab\nfunction testWithBoundaries(testCase)\n    data = testCase.inputData;\n    % Pre-computation (NOT measured)\n    preparedData = preprocess(data);\n\n    testCase.startMeasuring();\n    result = functionUnderTest(preparedData);\n    testCase.stopMeasuring();\n\n    % Verification (NOT measured)\n    testCase.verifyEqual(size(result), [100 1]);\nend\n```\n\n### 3. No boundary — Entire method is measured\n\nThe whole `Test` method body is timed. Use only when the entire method IS the workload:\n\n```matlab\nfunction testSlowFunction(testCase, DataSize) %#ok\u003CINUSD>\n    data = testCase.inputData;\n    result = slowFunction(data);\n    testCase.verifyNotEmpty(result);\nend\n```\n\n## Parameterization\n\nParameterize tests to measure across different input sizes or configurations.\n\n### `MethodSetupParameter` — When setup uses the parameter\n\n```matlab\nproperties (MethodSetupParameter)\n    DataSize = struct('Small', 100, 'Medium', 1000, 'Large', 10000)\nend\n\nmethods (TestMethodSetup)\n    function setupData(testCase, DataSize)\n        testCase.inputData = randn(DataSize, 1);\n    end\nend\n```\n\n### `TestParameter` — When only test methods use the parameter\n\n```matlab\nproperties (TestParameter)\n    Algorithm = {'chol', 'lu', 'qr'}\nend\n\nmethods (Test)\n    function testSolve(testCase, Algorithm)\n        ...\n    end\nend\n```\n\n**Critical gotcha:** Do NOT use `TestParameter` for properties consumed by `TestMethodSetup`. MATLAB will error with \"Define 'X' as a MethodSetupParameter.\" If your setup method needs the parameter, it must be `MethodSetupParameter`.\n\n### Combining Both — Size in setup, algorithm in test\n\n```matlab\nproperties (MethodSetupParameter)\n    DataSize = struct('Small', 100, 'Medium', 1000, 'Large', 10000)\nend\n\nproperties (TestParameter)\n    Algorithm = {'chol', 'lu', 'qr'}\nend\n\nmethods (TestMethodSetup)\n    function setupData(testCase, DataSize)\n        testCase.inputData = randn(DataSize);\n    end\nend\n\nmethods (Test)\n    function testSolve(testCase, Algorithm)\n        A = testCase.inputData' * testCase.inputData; % SPD matrix\n        data = A;\n        while testCase.keepMeasuring\n            result = decomposition(data, Algorithm);\n        end\n        testCase.verifyNotEmpty(result);\n    end\nend\n```\n\nThis produces 9 test points (3 sizes × 3 algorithms).\n\n## Lean Setup — Critical Rule\n\nALL setup must be outside the measurement boundary:\n\n| Setup Task | Where to Put It |\n|-----------|-----------------|\n| Data generation | `TestMethodSetup` |\n| Loading files | `TestClassSetup` |\n| Creating objects | `TestMethodSetup` or `TestClassSetup` |\n| Path manipulation | `TestClassSetup` |\n| RNG seeding | `TestMethodSetup` |\n\n**Never** include setup\u002Fteardown inside the measured region. This inflates timing and adds noise.\n\n**Copy properties to local variables before measuring.** Don't access `testCase.PropertyName` inside the measurement boundary — it measures the `matlab.perftest.TestCase` indexing overhead. Assign to a local variable outside the boundary instead:\n\n```matlab\n% Correct: local variable assigned before measurement\ndata = testCase.inputData;\nwhile testCase.keepMeasuring\n    result = myFunction(data);\nend\n```\n\n```matlab\nmethods (TestMethodSetup)\n    function setupData(testCase, DataSize)\n        rng(42, 'twister');  % Deterministic data\n        testCase.inputData = randn(DataSize, 1);\n    end\nend\n```\n\n## Noise and Duration\n\n### Target Duration\n- Each test point should take **>10ms** to execute\n- If too fast, increase data size or use `keepMeasuring`\n- Sub-millisecond tests produce unreliable results\n\n### Reducing Noise\n- Use `keepMeasuring` for fast operations\n- Pre-allocate all data in setup\n- Suppress all output (`'Display', 'off'`)\n- Avoid file I\u002FO in the measured region\n- Avoid `drawnow`, `pause`, or GUI operations\n- Seed RNG in setup for deterministic data\n\n### Interpreting Results\n\n```matlab\nresults = runperf('MyPerformanceTest');\n\n% Access timing statistics\nfor i = 1:numel(results)\n    samples = results(i).Samples.MeasuredTime;\n    fprintf('%s: median=%.4fs, std=%.4fs, CV=%.1f%%\\n', ...\n        results(i).Name, median(samples), std(samples), ...\n        100*std(samples)\u002Fmean(samples));\nend\n```\n\nA coefficient of variation (CV) above 10% indicates noisy results — revisit your test setup.\n\n## Anti-Patterns\n\n| Anti-Pattern | Why It's Wrong | Fix |\n|-------------|---------------|-----|\n| Setup inside measurement | Inflates timing, adds noise | Move to `TestMethodSetup` |\n| Sub-1ms test without `keepMeasuring` | Noise dominates | Use `keepMeasuring` or increase data size |\n| `tic\u002Ftoc` instead of framework | No statistical rigor, no warmup handling | Use `runperf`\u002F`keepMeasuring` |\n| `TestParameter` for setup params | Framework error at runtime | Use `MethodSetupParameter` |\n| Single test covering multiple APIs | Can't isolate regressions | Split into focused tests |\n| Random data without seeding RNG | Non-deterministic, harder to debug | `rng(42, 'twister')` in setup |\n| Printing\u002Fplotting in measured code | Console\u002Fgraphics I\u002FO adds noise | Suppress all output |\n\n## Comparing Results Over Time\n\nSave and compare results to detect regressions:\n\n```matlab\n% Save baseline\nbaselineResults = runperf('MyPerformanceTest');\nsave('perfBaseline.mat', 'baselineResults');\n\n% Later: compare against baseline\ncurrentResults = runperf('MyPerformanceTest');\nload('perfBaseline.mat');\n\nfor i = 1:numel(currentResults)\n    baseMed = median(baselineResults(i).Samples.MeasuredTime);\n    currMed = median(currentResults(i).Samples.MeasuredTime);\n    ratio = currMed \u002F baseMed;\n    status = \"OK\";\n    if ratio > 1.2\n        status = \"REGRESSION\";\n    elseif ratio \u003C 0.8\n        status = \"IMPROVEMENT\";\n    end\n    fprintf('%s: %.4fs -> %.4fs (%.2fx) %s\\n', ...\n        currentResults(i).Name, baseMed, currMed, ratio, status);\nend\n```\n\n## Test Granularity\n\nWhen asked to write performance tests, consider which level is appropriate:\n\n| Level | Scope | Parameterized? | Duration Target |\n|-------|-------|---------------|-----------------|\n| **Unit** | Single operation (e.g., `svd`, `mldivide`) | Yes — sweep sizes | >10ms per testpoint |\n| **System** | One function end-to-end | Yes — sweep sizes | >10ms per testpoint |\n| **Workflow (ALB)** | Complete multi-step customer workflow | No — one representative size | 0.5–5s total |\n\n**When to use each:**\n- **Unit**: Function has multiple expensive operations and you need to isolate which one regressed\n- **System**: Default choice — measures the function as users call it\n- **Workflow**: Validates that unit optimizations translate to real-world speedups; catches cross-function bottlenecks\n\nIf unsure, generate system-level tests first, then ask whether unit-level decomposition or workflow-level benchmarks are needed.\n\n### Workflow Benchmarks (Application-Level)\n\nFor end-to-end workflow benchmarks, the structure differs from unit\u002Fsystem tests:\n\n- **No parameterization** — one representative problem size (that's what unit tests are for)\n- **Realistic data** — production-scale inputs, not synthetic\n- **Single test method** — the whole workflow is one testpoint\n- **`startMeasuring`\u002F`stopMeasuring`** — always (never `keepMeasuring`)\n- **Setup in `TestClassSetup`** — load data once, not per method\n- **Target 0.5–5s** — sub-0.5s is noise-dominated; >30s slows iteration\n\nSee `references\u002FtExampleWorkflow.m` for the complete template.\n\n## Quality Checklist\n\nVerify after generating each test class:\n\n- [ ] Setup is outside the measurement boundary (`TestMethodSetup`)\n- [ ] Properties copied to local variables before measuring\n- [ ] Each test point exceeds 10ms (or uses `keepMeasuring` if faster)\n- [ ] RNG seeded for deterministic data\n- [ ] No console output, plotting, or file I\u002FO in measured region\n- [ ] Parameterized by data size\n- [ ] Single API\u002Foperation per test method (not bundling multiple)\n- [ ] `MethodSetupParameter` used (not `TestParameter`) when setup consumes the parameter\n\n## Reference Files\n\n- `references\u002FFeaturePerformanceTest.m` — Performance test class template with all measurement patterns\n- `references\u002FtExampleWorkflow.m` — Workflow-level benchmark template (application-level)\n- `references\u002Fsimulink-template.md` — Performance test template for Simulink model benchmarks\n\nCopyright 2026 The MathWorks, Inc.\n","# Writing MATLAB Performance Tests\n\nWrite 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.\n\n## When to Use\n\n- User wants to write repeatable performance tests for their MATLAB code\n- User needs to benchmark functions with statistical confidence\n- User wants to detect performance regressions over time\n- User is setting up continuous performance monitoring\n- User asks how to use `runperf` or `matlab.perftest.TestCase`\n\n## When NOT to Use\n\n- User wants a quick one-off timing (use `timeit` instead — see `matlab-optimize-performance`)\n- User wants to optimize existing code (use `matlab-optimize-performance`)\n- User wants to measure memory usage (use `matlab-optimize-memory`)\n- User wants to profile code to find bottlenecks (use `matlab-optimize-performance`, Step 2)\n\n## Framework: `matlab.perftest.TestCase`\n\nAll performance tests subclass `matlab.perftest.TestCase` and use measurement boundaries to control what gets timed.\n\n### Basic Template\n\n```matlab\nclassdef MyFeaturePerformanceTest \u003C matlab.perftest.TestCase\n\n    properties (MethodSetupParameter)\n        DataSize = struct('Small', 100, 'Medium', 1000, 'Large', 10000)\n    end\n\n    properties\n        inputData\n    end\n\n    methods (TestMethodSetup)\n        function setupData(testCase, DataSize)\n            % ALL setup outside the measurement boundary\n            testCase.inputData = randn(DataSize, 1);\n        end\n    end\n\n    methods (Test)\n        function testMyFunction(testCase)\n            data = testCase.inputData;\n            while testCase.keepMeasuring\n                result = myFunction(data);\n            end\n            testCase.verifyNotEmpty(result);\n        end\n    end\nend\n```\n\n### Running Performance Tests\n\n```matlab\n% Run with statistical rigor (automatic sample size)\nresults = runperf('MyFeaturePerformanceTest');\n\n% View results\ndisp(results)\n\n% Fixed sample count (faster, less statistical power)\nimport matlab.perftest.TimeExperiment;\nsuite = testsuite('MyFeaturePerformanceTest');\nexperiment = TimeExperiment.withFixedSampleSize(4);\nresults = run(experiment, suite);\n```\n\n## Measurement Boundaries\n\nThe framework offers three ways to control what gets measured:\n\n### 1. `keepMeasuring` — Needed when code is fast (\u003C10ms)\n\nAutomatically loops the code until enough samples are collected. Required for sub-10ms operations to achieve statistical rigor; works at any speed but adds overhead for slower code where `startMeasuring`\u002F`stopMeasuring` is preferred:\n\n```matlab\nfunction testFastFunction(testCase)\n    data = testCase.inputData;\n    while testCase.keepMeasuring\n        result = fastFunction(data);\n    end\n    testCase.verifyNotEmpty(result);\nend\n```\n\n### 2. `startMeasuring`\u002F`stopMeasuring` — For precise control\n\nUse when you need setup between iterations or want to exclude specific code:\n\n```matlab\nfunction testWithBoundaries(testCase)\n    data = testCase.inputData;\n    % Pre-computation (NOT measured)\n    preparedData = preprocess(data);\n\n    testCase.startMeasuring();\n    result = functionUnderTest(preparedData);\n    testCase.stopMeasuring();\n\n    % Verification (NOT measured)\n    testCase.verifyEqual(size(result), [100 1]);\nend\n```\n\n### 3. No boundary — Entire method is measured\n\nThe whole `Test` method body is timed. Use only when the entire method IS the workload:\n\n```matlab\nfunction testSlowFunction(testCase, DataSize) %#ok\u003CINUSD>\n    data = testCase.inputData;\n    result = slowFunction(data);\n    testCase.verifyNotEmpty(result);\nend\n```\n\n## Parameterization\n\nParameterize tests to measure across different input sizes or configurations.\n\n### `MethodSetupParameter` — When setup uses the parameter\n\n```matlab\nproperties (MethodSetupParameter)\n    DataSize = struct('Small', 100, 'Medium', 1000, 'Large', 10000)\nend\n\nmethods (TestMethodSetup)\n    function setupData(testCase, DataSize)\n        testCase.inputData = randn(DataSize, 1);\n    end\nend\n```\n\n### `TestParameter` — When only test methods use the parameter\n\n```matlab\nproperties (TestParameter)\n    Algorithm = {'chol', 'lu', 'qr'}\nend\n\nmethods (Test)\n    function testSolve(testCase, Algorithm)\n        ...\n    end\nend\n```\n\n**Critical gotcha:** Do NOT use `TestParameter` for properties consumed by `TestMethodSetup`. MATLAB will error with \"Define 'X' as a MethodSetupParameter.\" If your setup method needs the parameter, it must be `MethodSetupParameter`.\n\n### Combining Both — Size in setup, algorithm in test\n\n```matlab\nproperties (MethodSetupParameter)\n    DataSize = struct('Small', 100, 'Medium', 1000, 'Large', 10000)\nend\n\nproperties (TestParameter)\n    Algorithm = {'chol', 'lu', 'qr'}\nend\n\nmethods (TestMethodSetup)\n    function setupData(testCase, DataSize)\n        testCase.inputData = randn(DataSize);\n    end\nend\n\nmethods (Test)\n    function testSolve(testCase, Algorithm)\n        A = testCase.inputData' * testCase.inputData; % SPD matrix\n        data = A;\n        while testCase.keepMeasuring\n            result = decomposition(data, Algorithm);\n        end\n        testCase.verifyNotEmpty(result);\n    end\nend\n```\n\nThis produces 9 test points (3 sizes × 3 algorithms).\n\n## Lean Setup — Critical Rule\n\nALL setup must be outside the measurement boundary:\n\n| Setup Task | Where to Put It |\n|-----------|-----------------|\n| Data generation | `TestMethodSetup` |\n| Loading files | `TestClassSetup` |\n| Creating objects | `TestMethodSetup` or `TestClassSetup` |\n| Path manipulation | `TestClassSetup` |\n| RNG seeding | `TestMethodSetup` |\n\n**Never** include setup\u002Fteardown inside the measured region. This inflates timing and adds noise.\n\n**Copy properties to local variables before measuring.** Don't access `testCase.PropertyName` inside the measurement boundary — it measures the `matlab.perftest.TestCase` indexing overhead. Assign to a local variable outside the boundary instead:\n\n```matlab\n% Correct: local variable assigned before measurement\ndata = testCase.inputData;\nwhile testCase.keepMeasuring\n    result = myFunction(data);\nend\n```\n\n```matlab\nmethods (TestMethodSetup)\n    function setupData(testCase, DataSize)\n        rng(42, 'twister');  % Deterministic data\n        testCase.inputData = randn(DataSize, 1);\n    end\nend\n```\n\n## Noise and Duration\n\n### Target Duration\n- Each test point should take **>10ms** to execute\n- If too fast, increase data size or use `keepMeasuring`\n- Sub-millisecond tests produce unreliable results\n\n### Reducing Noise\n- Use `keepMeasuring` for fast operations\n- Pre-allocate all data in setup\n- Suppress all output (`'Display', 'off'`)\n- Avoid file I\u002FO in the measured region\n- Avoid `drawnow`, `pause`, or GUI operations\n- Seed RNG in setup for deterministic data\n\n### Interpreting Results\n\n```matlab\nresults = runperf('MyPerformanceTest');\n\n% Access timing statistics\nfor i = 1:numel(results)\n    samples = results(i).Samples.MeasuredTime;\n    fprintf('%s: median=%.4fs, std=%.4fs, CV=%.1f%%\\n', ...\n        results(i).Name, median(samples), std(samples), ...\n        100*std(samples)\u002Fmean(samples));\nend\n```\n\nA coefficient of variation (CV) above 10% indicates noisy results — revisit your test setup.\n\n## Anti-Patterns\n\n| Anti-Pattern | Why It's Wrong | Fix |\n|-------------|---------------|-----|\n| Setup inside measurement | Inflates timing, adds noise | Move to `TestMethodSetup` |\n| Sub-1ms test without `keepMeasuring` | Noise dominates | Use `keepMeasuring` or increase data size |\n| `tic\u002Ftoc` instead of framework | No statistical rigor, no warmup handling | Use `runperf`\u002F`keepMeasuring` |\n| `TestParameter` for setup params | Framework error at runtime | Use `MethodSetupParameter` |\n| Single test covering multiple APIs | Can't isolate regressions | Split into focused tests |\n| Random data without seeding RNG | Non-deterministic, harder to debug | `rng(42, 'twister')` in setup |\n| Printing\u002Fplotting in measured code | Console\u002Fgraphics I\u002FO adds noise | Suppress all output |\n\n## Comparing Results Over Time\n\nSave and compare results to detect regressions:\n\n```matlab\n% Save baseline\nbaselineResults = runperf('MyPerformanceTest');\nsave('perfBaseline.mat', 'baselineResults');\n\n% Later: compare against baseline\ncurrentResults = runperf('MyPerformanceTest');\nload('perfBaseline.mat');\n\nfor i = 1:numel(currentResults)\n    baseMed = median(baselineResults(i).Samples.MeasuredTime);\n    currMed = median(currentResults(i).Samples.MeasuredTime);\n    ratio = currMed \u002F baseMed;\n    status = \"OK\";\n    if ratio > 1.2\n        status = \"REGRESSION\";\n    elseif ratio \u003C 0.8\n        status = \"IMPROVEMENT\";\n    end\n    fprintf('%s: %.4fs -> %.4fs (%.2fx) %s\\n', ...\n        currentResults(i).Name, baseMed, currMed, ratio, status);\nend\n```\n\n## Test Granularity\n\nWhen asked to write performance tests, consider which level is appropriate:\n\n| Level | Scope | Parameterized? | Duration Target |\n|-------|-------|---------------|-----------------|\n| **Unit** | Single operation (e.g., `svd`, `mldivide`) | Yes — sweep sizes | >10ms per testpoint |\n| **System** | One function end-to-end | Yes — sweep sizes | >10ms per testpoint |\n| **Workflow (ALB)** | Complete multi-step customer workflow | No — one representative size | 0.5–5s total |\n\n**When to use each:**\n- **Unit**: Function has multiple expensive operations and you need to isolate which one regressed\n- **System**: Default choice — measures the function as users call it\n- **Workflow**: Validates that unit optimizations translate to real-world speedups; catches cross-function bottlenecks\n\nIf unsure, generate system-level tests first, then ask whether unit-level decomposition or workflow-level benchmarks are needed.\n\n### Workflow Benchmarks (Application-Level)\n\nFor end-to-end workflow benchmarks, the structure differs from unit\u002Fsystem tests:\n\n- **No parameterization** — one representative problem size (that's what unit tests are for)\n- **Realistic data** — production-scale inputs, not synthetic\n- **Single test method** — the whole workflow is one testpoint\n- **`startMeasuring`\u002F`stopMeasuring`** — always (never `keepMeasuring`)\n- **Setup in `TestClassSetup`** — load data once, not per method\n- **Target 0.5–5s** — sub-0.5s is noise-dominated; >30s slows iteration\n\nSee `references\u002FtExampleWorkflow.m` for the complete template.\n\n## Quality Checklist\n\nVerify after generating each test class:\n\n- [ ] Setup is outside the measurement boundary (`TestMethodSetup`)\n- [ ] Properties copied to local variables before measuring\n- [ ] Each test point exceeds 10ms (or uses `keepMeasuring` if faster)\n- [ ] RNG seeded for deterministic data\n- [ ] No console output, plotting, or file I\u002FO in measured region\n- [ ] Parameterized by data size\n- [ ] Single API\u002Foperation per test method (not bundling multiple)\n- [ ] `MethodSetupParameter` used (not `TestParameter`) when setup consumes the parameter\n\n## Reference Files\n\n- `references\u002FFeaturePerformanceTest.m` — Performance test class template with all measurement patterns\n- `references\u002FtExampleWorkflow.m` — Workflow-level benchmark template (application-level)\n- `references\u002Fsimulink-template.md` — Performance test template for Simulink model benchmarks\n\nCopyright 2026 The MathWorks, Inc.\n",{"name":5,"license":25,"metadata":26,"description":7},"MathWorks BSD-3-Clause",{"author":27,"version":28},"MathWorks","1.0","master","49e49abf2f670d429e0b7e2c0349739c3fdd5cbe","skills\u002Fmatlab-write-performance-tests",5,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium","https:\u002F\u002Fgithub.com\u002Fstanfish06","https:\u002F\u002Fwww.stanfish.dev\u002F","2026-11-14 21:31:37",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add stanfish06\u002Fskillquarium --skill matlab-write-performance-tests",{"tool":43,"command":44},"bunx","bunx skills add stanfish06\u002Fskillquarium --skill matlab-write-performance-tests",{"tool":46,"command":47},"pnpm","pnpm dlx skills add stanfish06\u002Fskillquarium --skill matlab-write-performance-tests","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-write-performance-tests\u002FSKILL.md",true,[51,56,62,66,70],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":16},"LICENSE.md","LICENSE","许可证",1482,{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"manifest.yaml","REFERENCE","参考文档",429,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-write-performance-tests\u002Fmanifest.yaml",{"path":63,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002FFeaturePerformanceTest.m",2392,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-write-performance-tests\u002Freferences\u002FFeaturePerformanceTest.m",{"path":67,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fsimulink-template.md",1521,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-write-performance-tests\u002Freferences\u002Fsimulink-template.md",{"path":71,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002FtExampleWorkflow.m",1598,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-write-performance-tests\u002Freferences\u002FtExampleWorkflow.m",[75,83,92,99,106,113],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":20},"01M76ZJTRVA456GD7K8Y3EP82H","zarr-python","Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3\u002FGCS storage, and NumPy\u002FDask\u002FXarray integration. Use for array layout, bounded I\u002FO, format migration, or scientific metadata preservation.","MIT","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":87,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":20},"01M76ZJQZ15Q1HKC5V85NHE325","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":87,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":20},"01M76ZJ8ASZ4QYQ70Y6SBA4Z4S","xarray","N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF\u002FGRIB\u002FZarr files, climate\u002Fweather\u002Foceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fxarray\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":20},"01M76ZHFBXD6VXPQ02VCEG202B","writing-mstest-tests","Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M76ZDFDF4N88RH6HSYGS7GP2","wgs-prs","End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core\u002Fsarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti\u002FTv and Het\u002FHom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwgs-prs\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":87,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":20},"01M76ZCC1SC68J42QK4MDC8RCG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[]]