performance-hunter

Find and fix performance bottlenecks in ANY language or framework

16 stars

Best use case

performance-hunter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Find and fix performance bottlenecks in ANY language or framework

Teams using performance-hunter should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/performance-hunter/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/performance-hunter/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/performance-hunter/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How performance-hunter Compares

Feature / Agentperformance-hunterStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Find and fix performance bottlenecks in ANY language or framework

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Performance Hunter - Universal Speed Optimization

## 🎯 When to Use This Skill

Use when experiencing:
- Slow page loads
- High CPU/memory usage
- Sluggish UI responses
- Database timeouts
- API latency issues
- "It used to be faster"

## ⚡ Quick Wins (80/20 Rule)

### The Big 5 Performance Killers (Check These First):
1. **N+1 Queries** - Multiple DB calls in loops
2. **Missing Indexes** - Unindexed database queries
3. **Large Bundles** - Unoptimized assets/dependencies
4. **Memory Leaks** - Unreleased references
5. **Blocking I/O** - Synchronous operations

## 🔍 Step 1: MEASURE (Don't Guess!)

### WITH MCP Tools:
```
"Profile the performance of [feature/endpoint/page]"
"Find performance bottlenecks in my application"
```

### WITHOUT MCP:

#### Quick Measurements:
```bash
# Overall response time
time curl http://localhost:3000/api/endpoint

# Multiple requests
for i in {1..10}; do time curl -s http://localhost:3000 > /dev/null; done

# Database query time (add to your queries temporarily)
console.time('query');
// your database query
console.timeEnd('query');
```

#### Browser Performance (Frontend):
```javascript
// Add performance marks
performance.mark('myFeature-start');
// ... your code ...
performance.mark('myFeature-end');
performance.measure('myFeature', 'myFeature-start', 'myFeature-end');

// View results
performance.getEntriesByType('measure');
```

## 🎯 Step 2: PROFILE (Find Bottlenecks)

### Universal Profiling by Language:

#### JavaScript/Node.js:
```bash
# Built-in profiler
node --inspect app.js
# Open chrome://inspect

# Or use console timing
console.time('operation');
// code
console.timeEnd('operation');
```

#### Python:
```python
import cProfile
import pstats

cProfile.run('your_function()', 'profile_stats')
stats = pstats.Stats('profile_stats')
stats.sort_stats('cumulative').print_stats(10)
```

#### Java:
```bash
# Use JProfiler or VisualVM
jstack <pid>  # Thread dump
jmap -histo <pid>  # Memory histogram
```

#### Go:
```go
import _ "net/http/pprof"
// Visit http://localhost:6060/debug/pprof/
```

#### Database Profiling:
```sql
-- PostgreSQL
EXPLAIN ANALYZE SELECT ...;

-- MySQL
SET profiling = 1;
SHOW PROFILES;
SHOW PROFILE FOR QUERY 1;

-- MongoDB
db.collection.find().explain("executionStats")
```

## 🔧 Step 3: OPTIMIZE (Fix Bottlenecks)

### 1. Database Optimization

#### WITH MCP (DB Schema Designer):
```
"Optimize my database queries for performance"
```

#### WITHOUT MCP:

**N+1 Query Fix:**
```javascript
// BAD: N+1 queries
const users = await getUsers();
for (const user of users) {
  user.posts = await getPostsByUserId(user.id); // N queries!
}

// GOOD: Single query with join
const usersWithPosts = await getUsersWithPosts(); // 1 query!
```

**Add Indexes:**
```sql
-- Find slow queries first
-- PostgreSQL
SELECT query, calls, mean_time
FROM pg_stat_statements
ORDER BY mean_time DESC;

-- Add index
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_posts_user_created ON posts(user_id, created_at);
```

### 2. Frontend Optimization

**Bundle Size:**
```bash
# Analyze bundle
npm run build -- --stats
webpack-bundle-analyzer stats.json

# Common fixes:
# - Lazy load routes
# - Tree shake unused code
# - Use CDN for large libraries
```

**React/Vue Specific:**
```javascript
// Use React.memo/Vue.computed
const ExpensiveComponent = React.memo(({ data }) => {
  // Only re-renders if data changes
});

// Virtualize long lists
import { FixedSizeList } from 'react-window';
```

### 3. Backend Optimization

**Caching Strategy:**
```javascript
// Memory cache for frequently accessed data
const cache = new Map();

async function getExpensiveData(key) {
  if (cache.has(key)) {
    return cache.get(key);
  }

  const data = await expensive_operation();
  cache.set(key, data);

  // TTL (time to live)
  setTimeout(() => cache.delete(key), 60000); // 1 minute

  return data;
}
```

**Async/Parallel Processing:**
```javascript
// BAD: Sequential
for (const item of items) {
  await processItem(item); // Slow!
}

// GOOD: Parallel (with limit)
const pLimit = require('p-limit');
const limit = pLimit(5); // Max 5 concurrent

await Promise.all(
  items.map(item => limit(() => processItem(item)))
);
```

### 4. Memory Optimization

**Find Memory Leaks:**
```javascript
// Node.js
if (global.gc) {
  global.gc();
  const used = process.memoryUsage();
  console.log('Memory:', Math.round(used.heapUsed / 1024 / 1024), 'MB');
}

// Common leak sources:
// - Event listeners not removed
// - Timers not cleared
// - Large objects in closures
// - Circular references
```

**Fix Common Leaks:**
```javascript
// Clean up event listeners
componentWillUnmount() {
  window.removeEventListener('resize', this.handler);
}

// Clear timers
const timer = setTimeout(...);
// Later:
clearTimeout(timer);

// WeakMap for object references
const cache = new WeakMap(); // GC-friendly
```

## 📊 Performance Monitoring

### Quick Monitoring Setup:

```javascript
// Log slow operations
function monitor(fn, name, threshold = 100) {
  return async (...args) => {
    const start = Date.now();
    const result = await fn(...args);
    const duration = Date.now() - start;

    if (duration > threshold) {
      console.warn(`⚠️ Slow operation: ${name} took ${duration}ms`);
    }

    return result;
  };
}

// Usage
const fastQuery = monitor(slowQuery, 'UserQuery', 50);
```

## 🚀 Quick Performance Checklist

### Frontend:
- [ ] Bundle size < 300KB (gzipped)
- [ ] First Contentful Paint < 1.8s
- [ ] Time to Interactive < 3.8s
- [ ] No layout shifts (CLS < 0.1)
- [ ] Images optimized (WebP, lazy loading)
- [ ] Code splitting implemented
- [ ] Service worker for caching

### Backend:
- [ ] API response time < 200ms (p95)
- [ ] Database queries < 50ms
- [ ] Connection pooling configured
- [ ] Rate limiting implemented
- [ ] Response compression enabled
- [ ] Static assets CDN cached
- [ ] Background jobs for heavy tasks

### Database:
- [ ] All queries use indexes
- [ ] No N+1 queries
- [ ] Connection pool sized correctly
- [ ] Read replicas for heavy reads
- [ ] Pagination for large datasets
- [ ] Vacuum/analyze scheduled (PostgreSQL)
- [ ] Query cache enabled (MySQL)

## 💡 Language-Specific Quick Wins

### Node.js:
```javascript
// Use cluster for multi-core
const cluster = require('cluster');
const numCPUs = require('os').cpus().length;

if (cluster.isMaster) {
  for (let i = 0; i < numCPUs; i++) {
    cluster.fork();
  }
}
```

### Python:
```python
# Use built-in accelerators
from functools import lru_cache

@lru_cache(maxsize=128)
def expensive_function(param):
    # Cached after first call
    return complex_calculation(param)
```

### Java:
```java
// Use StringBuilder for string concatenation
StringBuilder sb = new StringBuilder();
for (String s : strings) {
    sb.append(s); // Much faster than + operator
}
```

## 🎯 Performance Goals by Type

### Web Application:
- Page load: < 3 seconds
- API calls: < 500ms
- Search: < 200ms
- Form submit: < 1 second

### Mobile App:
- Launch: < 2 seconds
- Screen transition: < 300ms
- List scroll: 60 FPS
- Network retry: Exponential backoff

### API Service:
- p50 latency: < 50ms
- p95 latency: < 200ms
- p99 latency: < 1 second
- Error rate: < 0.1%

## 📈 Before/After Metrics Template

```markdown
## Performance Optimization Report

### Metric | Before | After | Improvement
---------|---------|--------|-------------
Page Load | 4.2s | 1.8s | -57%
API Response | 800ms | 180ms | -77%
Memory Usage | 512MB | 320MB | -37%
Bundle Size | 1.2MB | 420KB | -65%

### Changes Made:
1. Added database indexes
2. Implemented caching layer
3. Enabled gzip compression
4. Lazy loaded images
5. Code split routes
```

Remember: Measure → Profile → Optimize → Verify! 🚀

Related Skills

performance-testing-review-multi-agent-review

16
from diegosouzapw/awesome-omni-skill

Use when working with performance testing review multi agent review

performance-testing-review-ai-review

16
from diegosouzapw/awesome-omni-skill

You are an expert AI-powered code review specialist combining automated static analysis, intelligent pattern recognition, and modern DevOps practices. Leverage AI tools (GitHub Copilot, Qodo, GPT-5, C

performance-optimizer

16
from diegosouzapw/awesome-omni-skill

Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems. Use when the user needs to improve performance, reduce resource usage, or identify and fix performance bottlenecks.

performance-optimization

16
from diegosouzapw/awesome-omni-skill

Optimize Node.js application performance with caching, clustering, profiling, and monitoring techniques

performance-engineer

16
from diegosouzapw/awesome-omni-skill

Expert performance engineer specializing in modern observability, application optimization, and scalable system performance. Masters OpenTelemetry, distributed tracing, load testing, multi-tier caching, Core Web Vitals, and performance monitoring. Handles end-to-end optimization, real user monitoring, and scalability patterns. Use PROACTIVELY for performance optimization, observability, or scalability challenges.

observability-monitoring-performance-engineer

16
from diegosouzapw/awesome-omni-skill

Expert performance engineer specializing in modern observability, application optimization, and scalable system performance. Masters OpenTelemetry, distributed tracing, load testing, multi-tier caching, Core Web Vitals, and performance monitoring. Handles end-to-end optimization, real user monitoring, and scalability patterns. Use PROACTIVELY for performance optimization, observability, or scalability challenges. Use when: the task directly matches performance engineer responsibilities within plugin observability-monitoring. Do not use when: a more specific framework or task-focused skill is clearly a better match.

kirby-performance-and-media

16
from diegosouzapw/awesome-omni-skill

Improve Kirby performance and media delivery (cache tuning, CDN, responsive images, lazy loading). Use when optimizing page speed, caching, or image handling.

k6 Performance Testing

16
from diegosouzapw/awesome-omni-skill

Modern load testing with k6 including thresholds, scenarios, and custom metrics

full-stack-orchestration-performance-engineer

16
from diegosouzapw/awesome-omni-skill

Expert performance engineer specializing in modern observability, application optimization, and scalable system performance. Masters OpenTelemetry, distributed tracing, load testing, multi-tier caching, Core Web Vitals, and performance monitoring. Handles end-to-end optimization, real user monitoring, and scalability patterns. Use PROACTIVELY for performance optimization, observability, or scalability challenges. Use when: the task directly matches performance engineer responsibilities within plugin full-stack-orchestration. Do not use when: a more specific framework or task-focused skill is clearly a better match.

eds-performance-debugging

16
from diegosouzapw/awesome-omni-skill

Guide for debugging and performance optimization of EDS blocks including error handling, FOUC prevention, Core Web Vitals optimization, and debugging workflows for Adobe Edge Delivery Services.

bounty-hunter

16
from diegosouzapw/awesome-omni-skill

Find, evaluate, and submit online bounties and hackathons for prize money. Use when user mentions "bounties", "hackathon", "earn money", "Superteam Earn", "prize money", "submissions", "freelance bounties", or asks to find paid opportunities. Covers discovery, eligibility filtering, content drafting, and submission workflows.

api-performance-api-performance

16
from diegosouzapw/awesome-omni-skill

Query optimization, caching, indexing