Performance Tuning
by @mikeclaw007
Deep performance tuning workflow—goals and measurement, profiling, hotspots, caching and concurrency trade-offs, system-specific tuning (DB, GC, network), an...
clawhub install performance-tuning📖 About This Skill
name: performance-tuning description: Deep performance tuning workflow—goals and measurement, profiling, hotspots, caching and concurrency trade-offs, system-specific tuning (DB, GC, network), and verification. Use when fixing latency, throughput, or resource saturation.
Performance Tuning (Deep Workflow)
Performance work is measurement-driven. Profile before optimizing; verify after changes; guard against regressions with benchmarks or production metrics.
When to Offer This Workflow
Trigger conditions:
Initial offer:
Use six stages: (1) frame goals & SLOs, (2) measure baseline, (3) profile & hypothesize, (4) implement changes, (5) verify & compare, (6) prevent regression). Confirm language/runtime and environment (prod-like data volume).
Stage 1: Frame Goals & SLOs
Goal: Numeric targets: p95 latency, throughput, max memory—not “faster.”
Questions
1. Which workloads matter most (batch vs interactive)? 2. Correctness constraints (approximation allowed or not)? 3. Cost budget for hardware vs engineering time?
Exit condition: One-page success criteria and out-of-scope areas.
Stage 2: Measure Baseline
Goal: Reproducible benchmark or RUM segment—same inputs, same conditions.
Practices
Exit condition: Baseline numbers + environment fingerprint (versions, flags).
Stage 3: Profile & Hypothesize
Goal: Find dominant cost: CPU bound, I/O bound, lock contention, allocation rate.
Tools (examples)
Exit condition: Hypothesis tied to evidence (e.g., “40% time in JSON parse”).
Stage 4: Implement Changes
Goal: Smallest change that addresses the hotspot; avoid clever without proof.
Levers
Stage 5: Verify & Compare
Goal: A/B or before/after with same workload; watch tail latency not only mean.
Production
Stage 6: Prevent Regression
Goal: Micro-benchmarks in CI (optional), budgets, or synthetic checks.