# Benchmark Optimization Loop (benchmark-optimization-loop)

> Turns speed-up requests into a bounded, measured loop: baseline first, one-hypothesis variants, a correctness gate, and the fastest safe variant wins.

- Category: [Performance](https://www.myskills.tools/en/categories/performance/)
- Source: Community · Affaan Mustafa
- Repository: https://github.com/affaan-m/ECC/tree/main/skills/benchmark-optimization-loop (commit 0765f7a)
- SKILL.md: https://github.com/affaan-m/ECC/blob/main/skills/benchmark-optimization-loop/SKILL.md
- Install command: `npx skills add affaan-m/ECC --skill benchmark-optimization-loop`
- License: MIT
- Compatible with: Claude Code, Codex, Cursor, Copilot, OpenCode
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✗
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.

## Core rule

Do not optimize until the operation, correctness gate, metric, baseline and search budget are defined.

## Execution Phases

1. **Define the baseline** — Fix the operation, the correctness gate that must stay green, the metric, the current baseline and the budget for variants, time, spend and data impact.
2. **Measure and find bottlenecks** — Measure the baseline and identify bottlenecks from evidence.
3. **Run one-hypothesis variants** — Each variant tests one hypothesis on the same input shape and goes in a variant table; for recursive search, log every run and compare against the prior accepted winner.
4. **Promote through the gate** — Reject variants that fail correctness, safety or reproducibility; promote the fastest safe one only when tests pass, the delta repeats and rollback is obvious.
5. **Codify and confirm** — Encode the winner in a script, command, test, config or doc, rerun baseline and winner to confirm the delta, and report exact commands and measurements.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Edits code and codifies the winning path in scripts, tests, configs or docs. |
| Command execution | Required | Runs benchmarks for the baseline and each variant, plus correctness tests. |
| Network outbound | Not required | The skill does not call for network access. |

## SKILL.md frontmatter (YAML)

```yaml
---
name: benchmark-optimization-loop
description: Convert 'make it faster' requests into a bounded measured optimization loop — baseline first, generate one-hypothesis variants, benchmark each against a correctness gate, and promote the fastest safe variant with reproducible commands. Use when asked to speed something up, try many variants, run recursive optimization, benchmark latency/throughput/cost, or pick the best implementation by repeated measured tests.
license: MIT
metadata:
  origin: ECC
tools: Read, Write, Edit, Bash, Grep, Glob
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/benchmark-optimization-loop/
