| name | check-perf |
| description | Analyze code for performance issues and suggest optimizations |
| disable-model-invocation | true |
| context | fork |
| agent | Explore |
| allowed-tools | Bash(git diff*), Bash(git show*), Read, Grep, Glob |
Performance Analysis
Analyze code changes for performance implications and optimization opportunities.
Scope
Review changes from: !git diff --name-only HEAD~1 or files specified in $ARGUMENTS
Performance Checklist
1. Database Operations
2. Memory Usage
3. API Performance
4. Algorithmic Complexity
5. Caching
6. Geographic/Spatial Operations
7. Deno-Specific
Metrics to Consider
| Operation | Target | Warning |
|---|
| API response time | < 200ms | > 500ms |
| Database query | < 50ms | > 200ms |
| Memory per request | < 10MB | > 50MB |
| Batch size | 100-1000 | > 10000 |
Output Format
## Performance Analysis Summary
**Impact Level**: [LOW | MEDIUM | HIGH]
**Files Reviewed**: X files
### Performance Issues
#### [IMPACT] Issue Title
- **File**: path/to/file.ts:line
- **Issue**: Description of the performance problem
- **Current complexity**: O(n^2) / Memory: ~XMB / Time: ~Xms
- **Suggested improvement**: How to optimize
- **Expected improvement**: X% faster / X% less memory
### Optimization Opportunities
- Optional improvements that aren't blocking
### Approved Changes
- List of changes with acceptable performance characteristics
### Benchmarks Suggested
- [ ] Specific scenarios that should be load tested
Invocation
/check-perf # Review uncommitted changes
/check-perf src/pdc/services/ # Review specific directory
/check-perf --focus=database # Focus on database operations