blob: 0a654713386455be1c7b12144a694ca2dd164172 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
---
name: performance-analysis
description: "Measure before optimizing, identify likely bottlenecks, make a targeted change, and verify the effect."
---
# Performance Analysis Skill
Measure before optimizing, identify likely bottlenecks, make a targeted change, and verify the effect.
## Subagents
When you need to delegate sub‑tasks, use the `pi-subagents` skill.
**Example:** To optimize a slow endpoint, run a **scout** to profile CPU usage in the `handler` function, another **scout** to measure I/O latency in the `storage` layer, and an **implementer** to apply algorithmic improvements while a **reviewer** compares benchmarks against the baseline.
*You may adapt the delegation pattern to fit the exact requirements of the codebase.*
## Workflow
### 1. Measure
- Profile before changes
- Establish baseline metrics
- Identify hot paths
### 2. Analyze
- Find actual bottlenecks
- Distinguish CPU vs I/O vs memory
- Consider algorithmic complexity
### 3. Target
- One bottleneck at a time
- Minimal, focused change
- Prefer algorithmic improvements
### 4. Verify
- Re-measure after change
- Compare to baseline
- Check for regressions
|