ln-31-performance-optimizer

Optimizes measured latency, throughput, memory, CPU, or I/O bottlenecks through profiling and keep-or-discard experiments.

556|83|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-31-performance-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ln-31-performance-optimizer
Source: https://github.com/levnikolaevich/claude-code-skills/tree/main/plugins/optimization-suite/skills/ln-31-performance-optimizer
Command: npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-31-performance-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents speculative or aesthetic code changes by requiring every optimization to target a measured bottleneck, prove improvement against a reproducible baseline, and pass correctness and operational constraints before being kept.

Core Features & Use Cases

  • Reproducible Baselines: Defines the primary metric, workload, environment, and acceptance threshold before editing, with repeated runs and variance reporting.
  • Profile-Driven Hypotheses: Builds a ranked cost map from profilers, tracing, and query diagnostics, then orders hypotheses by measured contribution and risk.
  • Atomic Keep-or-Discard Experiments: Applies the smallest coherent change per hypothesis, re-runs the exact baseline benchmark, and keeps or reverts based on evidence.
  • Use Case: A service endpoint shows high p99 latency. Use this Skill to profile the hot path, test a caching hypothesis under identical load, and retain the change only if latency improves beyond noise without breaking correctness.

Quick Start

Ask the agent to use the performance optimizer skill to profile the slow endpoint, establish a baseline benchmark, and run keep-or-discard experiments until the latency target is met.

Frequently Asked Questions about ln-31-performance-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize a slow endpoint or function with evidence?

Define the target metric and acceptance threshold, build a reproducible baseline benchmark, then profile the end-to-end path to rank costs. Test one hypothesis per atomic change and keep it only if the metric improves beyond noise with all constraints passing.

What tools does performance profiling use in this workflow?

It prefers existing profilers, tracing, query diagnostics, allocation tools, and OS-level metrics already in the repository. When unavailable, it falls back to targeted instrumentation with a cleanup plan, keeping overhead bounded and removable.

When should I not use a performance optimization workflow?

Do not use it for unbiased A/B comparisons, aesthetic refactoring, or when the symptom is actually a correctness, configuration, capacity, or dependency failure. A wrong-tool gate confirms the problem is genuinely performance-related first.

Why does a single faster benchmark run not prove an optimization works?

Single runs hide noise and environmental variance. The workflow requires repeated runs, distribution or percentile reporting, comparable conditions, and sometimes interleaved or paired baseline-versus-candidate comparisons before accepting improvement.

What happens if no experiment improves the target metric?

All experiments are discarded, the baseline is restored, and the verdict is NO_CHANGE. If a reproducible baseline or safe restoration path is unavailable, the run stops early with a BLOCKED verdict and an explanation.