AutoLoop — metric-driven optimization loops
Agent-agnostic hill-climbing loops inspired by Karpathy's autoresearch: define a metric, let the agent propose a change, measure, keep it only if the number improved, and repeat.
Implementation note
When to use: optimization problems with a measurable number — latency, benchmark score, model accuracy, query cost — where you want hill-climbing automated rather than hand-tuned. Inspired by Karpathy's autoresearch pattern. How it works: you define a metric; each iteration the agent proposes a change, the harness measures the metric, and the change is kept only if the number improved — otherwise it is discarded — then the cycle repeats. The keep-only-if-improved rule makes progress monotonic by construction, and because the harness does the measuring, the agent cannot grade its own work. It is agent-agnostic: Claude Code, Codex, Cursor, or Gemini CLI. Safety: measurement-gated acceptance is the rail — no change survives on plausibility alone. The classic residual risk is metric gaming, where the number improves while something unmeasured degrades, so pair the target metric with guard checks (tests still pass, correctness holds) and cap total iterations to bound spend.
Source: armgabrielyan/autoloop ↗
More performance loops
Benchmark regression watch
Run the benchmark suite every 30 minutes during active development and raise a flag the moment any benchmark slips more than 5 percent from baseline.
Bundle size budget
Shrink the production JavaScript bundle under a hard budget by attacking the largest modules with code-splitting, lighter imports, and dead-weight removal.
Hold a stable frame rate
Measure frame time, CPU, GPU, and memory under fixed conditions and keep only regression-free optimizations.