performance-profiler

Identifies performance bottlenecks including N+1 queries, inefficient loops, memory leaks, and slow algorithms. Use when user mentions performance issues, slow code, optimization, or profiling.

242 stars

Best use case

performance-profiler is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Identifies performance bottlenecks including N+1 queries, inefficient loops, memory leaks, and slow algorithms. Use when user mentions performance issues, slow code, optimization, or profiling.

Identifies performance bottlenecks including N+1 queries, inefficient loops, memory leaks, and slow algorithms. Use when user mentions performance issues, slow code, optimization, or profiling.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "performance-profiler" skill to help with this workflow task. Context: Identifies performance bottlenecks including N+1 queries, inefficient loops, memory leaks, and slow algorithms. Use when user mentions performance issues, slow code, optimization, or profiling.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/performance-profiler/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/crazydubya/performance-profiler/SKILL.md"

Manual Installation

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

How performance-profiler Compares

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

Frequently Asked Questions

What does this skill do?

Identifies performance bottlenecks including N+1 queries, inefficient loops, memory leaks, and slow algorithms. Use when user mentions performance issues, slow code, optimization, or profiling.

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 Profiler

Identifies and suggests fixes for common performance bottlenecks in code.

## When to Use
- User reports performance issues or slow code
- Optimization requests
- Code review for performance
- User mentions "slow", "bottleneck", "optimization", "memory leak"

## Instructions

### 1. Identify Performance Anti-Patterns

**N+1 Query Problems:**
```javascript
// Bad: N+1 queries
users.forEach(user => {
  const posts = db.query('SELECT * FROM posts WHERE user_id = ?', user.id);
});

// Good: Single query with JOIN
const usersWithPosts = db.query('SELECT * FROM users LEFT JOIN posts ON users.id = posts.user_id');
```

**Inefficient Loops:**
```python
# Bad: O(n²) nested loops
for item in list1:
    for other in list2:
        if item.id == other.id:
            process(item, other)

# Good: O(n) with hash map
lookup = {other.id: other for other in list2}
for item in list1:
    if item.id in lookup:
        process(item, lookup[item.id])
```

**Unnecessary Re-renders (React):**
```javascript
// Bad: Creates new object on every render
<Component style={{ margin: 10 }} />

// Good: Define outside or useMemo
const style = { margin: 10 };
<Component style={style} />
```

**Memory Leaks:**
- Event listeners not cleaned up
- Timers not cleared
- Circular references
- Large caches without limits

**Blocking Operations:**
- Synchronous file I/O
- Long-running calculations in UI thread
- Missing pagination

### 2. Database Performance

**Check for:**
- Missing indexes on foreign keys
- SELECT * instead of specific columns
- Queries in loops (N+1)
- Missing query limits
- Inefficient JOINs

**Suggest:**
- Add indexes: `CREATE INDEX idx_user_id ON posts(user_id);`
- Use eager loading/prefetching
- Implement pagination
- Use database query analyzers (EXPLAIN)

### 3. Algorithm Complexity

**Identify:**
- O(n²) or worse algorithms
- Redundant calculations
- Unnecessary sorting
- Inefficient data structures

**Common fixes:**
- Hash maps for O(1) lookup vs O(n) array search
- Binary search O(log n) vs linear search O(n)
- Memoization for repeated calculations
- Lazy evaluation for expensive operations

### 4. Frontend Performance

**Check for:**
- Large bundle sizes
- Unoptimized images
- Missing code splitting
- Inefficient React components
- Missing memoization

**Suggest:**
- Lazy loading: `const Component = lazy(() => import('./Component'));`
- Image optimization
- Debounce/throttle expensive operations
- Virtual scrolling for long lists
- Web Workers for heavy computations

### 5. Network Performance

**Issues:**
- Too many HTTP requests
- Large payloads
- Missing caching
- Synchronous requests

**Solutions:**
- Bundle/concatenate resources
- Implement compression (gzip, brotli)
- Use HTTP/2 multiplexing
- Add caching headers
- Parallel vs sequential requests

### 6. Generate Performance Report

```
Performance Analysis
===================

Critical Issues (Fix Immediately):
1. N+1 query in UserController.index (file.js:45)
   - Impact: 100+ DB queries per request
   - Fix: Use eager loading or JOIN

2. Memory leak in EventEmitter (file.js:120)
   - Impact: Memory grows unbounded
   - Fix: Remove listeners in cleanup

High Priority:
3. O(n²) loop in processData (file.js:200)
   - Impact: Slow for large datasets
   - Fix: Use hash map for O(n)

Medium Priority:
4. Missing image optimization
   - Impact: Slow page load
   - Fix: Use next/image or optimize manually
```

### 7. Profiling Tools

**JavaScript:**
- Chrome DevTools Performance tab
- Node.js --inspect flag
- `console.time()` / `console.timeEnd()`

**Python:**
- cProfile module
- line_profiler
- memory_profiler

**Database:**
- EXPLAIN / EXPLAIN ANALYZE
- Slow query log
- pg_stat_statements (PostgreSQL)

## Best Practices
- Profile before optimizing
- Focus on hot paths (80/20 rule)
- Measure impact of changes
- Consider readability vs performance trade-offs
- Document performance-critical sections

Related Skills

web-performance-seo

242
from aiskillstore/marketplace

Fix PageSpeed Insights/Lighthouse accessibility "!" errors caused by contrast audit failures (CSS filters, OKLCH/OKLAB, low opacity, gradient text, image backgrounds). Use for accessibility-driven SEO/performance debugging and remediation.

web-performance-optimization

242
from aiskillstore/marketplace

Optimize website and web application performance including loading speed, Core Web Vitals, bundle size, caching strategies, and runtime performance

performance-testing-review-multi-agent-review

242
from aiskillstore/marketplace

Use when working with performance testing review multi agent review

performance-testing-review-ai-review

242
from aiskillstore/marketplace

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-profiling

242
from aiskillstore/marketplace

Performance profiling principles. Measurement, analysis, and optimization techniques.

performance-engineer

242
from aiskillstore/marketplace

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.

application-performance-performance-optimization

242
from aiskillstore/marketplace

Optimize end-to-end application performance with profiling, observability, and backend/frontend tuning. Use when coordinating performance optimization across the stack.

fixing-motion-performance

242
from aiskillstore/marketplace

Fix animation performance issues.

convex-performance-audit

242
from aiskillstore/marketplace

Audits and optimizes Convex application performance across hot-path reads, write contention, subscription cost, and function limits. Use this skill when a Convex feature is slow or expensive, npx convex insights shows high bytes or documents read, OCC conflict errors or mutation retries appear, subscriptions or UI updates are costly, functions hit execution or transaction limits, or the user mentions performance, latency, read amplification, or invalidation problems in a Convex app.

performance-vitals

242
from aiskillstore/marketplace

Enforce Core Web Vitals optimization. Use when building user-facing features, reviewing performance, or when Lighthouse scores drop. Covers LCP, FID/INP, CLS, and optimization techniques.

when-profiling-performance-use-performance-profiler

242
from aiskillstore/marketplace

Comprehensive performance profiling, bottleneck detection, and optimization system

when-analyzing-performance-use-performance-analysis

242
from aiskillstore/marketplace

Comprehensive performance analysis, bottleneck detection, and optimization recommendations for Claude Flow swarms