Skip to content
Back to skills

Performance Optimization

ASecurity

Improve performance through measurement-driven cycles. Never optimize without a baseline. Never ship an optimization that breaks tests. ---

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
code-qualityperformance

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add SeongwoongCho/adaptive-harness --skill performance-optimization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Performance Optimization?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Performance Optimization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/seongwoongcho-performance-optimization/badge)](https://www.skillsdirectory.com/skills/seongwoongcho-performance-optimization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Performance-Optimization Skill

Improve performance through measurement-driven cycles. Never optimize without a baseline. Never ship an optimization that breaks tests.

---

## Steps

1. **Establish baseline**
   - Run existing benchmarks (look for `benchmark`, `perf`, `bench` scripts)
   - If no benchmark exists: write a minimal timing harness for the hot path
   - Record: current latency (p50/p99), throughput (ops/sec), or memory (MB) — whichever is relevant
   - Document the baseline clearly before making any change

2. **Profile**
   - Use `cProfile`, `py-spy`, `perf`, `chrome://tracing`, or language-appropriate profiler
   - Identify the top 3 bottlenecks by time or memory contribution
   - Do not optimize based on intuition alone

3. **Hypothesize**
   - For each bottleneck, write a specific, falsifiable hypothesis:
     - "Replacing list lookup with a set will reduce `find_user` from O(n) to O(1), improving p99 by ~40%"
   - Order hypotheses by expected impact (highest first)

4. **Implement — one optimization at a time**
   - Pick the highest-impact hypothesis
   - Make only the change required to test this hypothesis
   - Do not clean up, refactor, or fix unrelated code in the same pass

5. **Measure**
   - Re-run the benchmark under the same conditions as the baseline
   - Record the new measurement
   - Compute the delta: `improvement = (baseline - new) / baseline * 100%`

6. **Accept or reject**
   - Accept if: improvement ≥ 5% and statistically reproducible (run 3 times)
   - Reject if: improvement < 5% or results are noisy — revert the change
   - Document the outcome regardless

7. **Verify correctness**
   - Run the full test suite
   - If any test fails: revert the optimization and mark the hypothesis as "breaks correctness"

8. **Repeat steps 4–7**
   - Work through remaining hypotheses in order
   - Stop when the performance target is met or all hypotheses are exhausted

9. **Report**
   - Baseline metrics
   - Each optimization attempted (accepted/rejected) with before/after measurements
   - Net improvement achieved
   - Remaining bottlenecks and why they were not pursued

Files in this skill

  • contract.yaml2.7 KB
  • skill.md2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.