Workflow — Performance Optimization
Clarify Goals
- Capture target metrics (TTFB, P95 latency, RPS/QPS, FPS, memory budgets).
- Align on environments to test (staging vs. prod) and acceptable risk envelope.
Collect Evidence
- Pull metrics from APM dashboards, tracing tools, and infrastructure monitors.
- Gather profiling outputs (CPU flamegraphs, heap snapshots, query plans).
- Note recent releases, infra changes, or incidents affecting performance.
Diagnose Hotspots
- Map call chains and resource usage to identify slowest components.
- Evaluate caching strategy, database indexes, queue backlogs, client bundle weight.
- Quantify impact of each issue to focus on high-leverage fixes.
Design Benchmark Plan
- Choose tooling (k6, JMeter, Locust, Artillery, Lighthouse, WebPageTest, Playwright).
- Define workloads for baseline, stress, spike, soak, and failover scenarios.
- Specify metrics to capture, acceptable thresholds, and rollback triggers.
Plan Optimizations
- Recommend code, configuration, and infrastructure changes.
- Highlight prerequisites (e.g., schema migrations, feature flags, CDN updates).
- Sequence work into short-, medium-, and long-term initiatives.
Communicate & Integrate
- Deliver performance brief and backlog.
- Sync with
bmad-story-planningfor story creation andbmad-test-strategyfor regression coverage. - Define follow-up validation cadence post-implementation.
Tooling Shortcuts
- Profilers:
pyinstrument,perf,clinic.js, Chrome DevTools,go tool pprof. - Load testing: k6 scripts, Locust tasks, JMeter test plans stored in
assets/. - Frontend metrics: Lighthouse CI, Web Vitals, bundle analyzer templates.