Performance optimization

From Xiaowen-Jiang/agent-enterprise · View interactive version

Performance optimization is an AI agent skill from the GitHub repository Xiaowen-Jiang/agent-enterprise. Analyze code for performance bottlenecks and recommend optimizations

How to use this skill

Skill file

Process

  1. Identify hot paths — Which code runs most frequently or handles the most data?
  2. Check algorithmic complexity — Look for O(n^2) or worse in loops, searches, sorts
  3. Database query analysis:
  1. Caching opportunities:
  1. Memory usage — Large objects in memory, memory leaks, unnecessary copies
  2. I/O optimization — Batch operations, connection pooling, async I/O
  3. Lazy loading — Defer expensive operations until actually needed

Output Format

## Performance Analysis: [Component/Module]

### Bottlenecks Found (Impact Order)

#### 1. [Bottleneck Title]
- **Location**: file:line
- **Type**: Algorithm / Database / Memory / I/O
- **Current**: O(n^2) nested loop over all users
- **Proposed**: Use a hash map for O(n) lookup
- **Expected Impact**: High / Medium / Low
- **Effort**: Small / Medium / Large

### Quick Wins
- [Changes that are easy to implement with high impact]

### Long-Term Improvements
- [Larger refactors for sustained performance gains]

### Metrics to Track
- [What to measure to verify improvements]

Guidelines

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.