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.

25 stars

Best use case

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

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.

Teams using performance-profiler 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-profiler/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/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

validating-performance-budgets

25
from ComeOnOliver/skillshub

Validate application performance against defined budgets to identify regressions early. Use when checking page load times, bundle sizes, or API response times against thresholds. Trigger with phrases like "validate performance budget", "check performance metrics", or "detect performance regression".

analyzing-query-performance

25
from ComeOnOliver/skillshub

This skill enables Claude to analyze and optimize database query performance. It activates when the user discusses query performance issues, provides an EXPLAIN plan, or asks for optimization recommendations. The skill leverages the query-performance-analyzer plugin to interpret EXPLAIN plans, identify performance bottlenecks (e.g., slow queries, missing indexes), and suggest specific optimization strategies. It is useful for improving database query execution speed and resource utilization.

providing-performance-optimization-advice

25
from ComeOnOliver/skillshub

Provide comprehensive prioritized performance optimization recommendations for frontend, backend, and infrastructure. Use when analyzing bottlenecks or seeking improvement strategies. Trigger with phrases like "optimize performance", "improve speed", or "performance recommendations".

profiling-application-performance

25
from ComeOnOliver/skillshub

Execute this skill enables AI assistant to profile application performance, analyzing cpu usage, memory consumption, and execution time. it is triggered when the user requests performance analysis, bottleneck identification, or optimization recommendations. the... Use when optimizing performance. Trigger with phrases like 'optimize', 'performance', or 'speed up'.

performance-testing

25
from ComeOnOliver/skillshub

This skill enables Claude to design, execute, and analyze performance tests using the performance-test-suite plugin. It is activated when the user requests load testing, stress testing, spike testing, or endurance testing, and when discussing performance metrics such as response time, throughput, and error rates. It identifies performance bottlenecks related to CPU, memory, database, or network issues. The plugin provides comprehensive reporting, including percentiles, graphs, and recommendations.

detecting-performance-regressions

25
from ComeOnOliver/skillshub

This skill enables Claude to automatically detect performance regressions in a CI/CD pipeline. It analyzes performance metrics, such as response time and throughput, and compares them against baselines or thresholds. Use this skill when the user requests to "detect performance regressions", "analyze performance metrics for regressions", or "find performance degradation" in a CI/CD environment. The skill is also triggered when the user mentions "baseline comparison", "statistical significance analysis", or "performance budget violations". It helps identify and report performance issues early in the development cycle.

performance-lighthouse-runner

25
from ComeOnOliver/skillshub

Performance Lighthouse Runner - Auto-activating skill for Frontend Development. Triggers on: performance lighthouse runner, performance lighthouse runner Part of the Frontend Development skill category.

performance-baseline-creator

25
from ComeOnOliver/skillshub

Performance Baseline Creator - Auto-activating skill for Performance Testing. Triggers on: performance baseline creator, performance baseline creator Part of the Performance Testing skill category.

optimizing-cache-performance

25
from ComeOnOliver/skillshub

Execute this skill enables AI assistant to analyze and improve application caching strategies. it optimizes cache hit rates, ttl configurations, cache key design, and invalidation strategies. use this skill when the user requests to "optimize cache performance"... Use when optimizing performance. Trigger with phrases like 'optimize', 'performance', or 'speed up'.

aggregating-performance-metrics

25
from ComeOnOliver/skillshub

This skill enables Claude to aggregate and centralize performance metrics from various sources. It is used when the user needs to consolidate metrics from applications, systems, databases, caches, queues, and external services into a central location for monitoring and analysis. The skill is triggered by requests to "aggregate metrics", "centralize performance metrics", or similar phrases related to metrics aggregation and monitoring. It facilitates designing a metrics taxonomy, choosing appropriate aggregation tools, and setting up dashboards and alerts.

memory-profiler-setup

25
from ComeOnOliver/skillshub

Memory Profiler Setup - Auto-activating skill for Performance Testing. Triggers on: memory profiler setup, memory profiler setup Part of the Performance Testing skill category.

inference-latency-profiler

25
from ComeOnOliver/skillshub

Inference Latency Profiler - Auto-activating skill for ML Deployment. Triggers on: inference latency profiler, inference latency profiler Part of the ML Deployment skill category.