# performance-profiling

performance-profiling guides performance analysis across Node.js and React, covering flame graphs, heap snapshot diffing, and event loop saturation.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 148 installs · ★ 274 repo stars
- Author: curiositech
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/performance-profiling/SKILL.md
- Updated: 2026-10-30
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/curiositech-performance-profiling

## What it does

This skill directs the agent to identify runtime bottlenecks before changing application code. It supports backend Node.js diagnostics using V8 inspection flags, `0x` flame graphs, and the `clinic` suite (`clinic doctor`, `clinic flame`, `clinic bubbles`). For input and output delays, it checks event loop utilization through `perf_hooks`.

On the client side, the instructions target long tasks, layout thrashing, and unnecessary component updates via React Profiler. Detecting memory leaks relies on comparing three consecutive heap snapshots to catch unbounded caches or listener accumulation.

The scope has a clear boundary: this skill diagnoses code bottlenecks, whereas distributed tracing, load generation, and database schema redesign require separate tools.

## Requirements
- Works with: Chrome

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill performance-profiling -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/performance-profiling/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/performance-profiling/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill performance-profiling -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/performance-profiling/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill performance-profiling -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/performance-profiling/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install curiositech/some_claude_skills .claude/skills/performance-profiling
```

2. **Manually: put the files in place**
- File: `.github/skills/performance-profiling/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill performance-profiling -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/curiositech/some_claude_skills --path .claude/skills/performance-profiling
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/performance-profiling/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill performance-profiling -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/performance-profiling/SKILL.md

## When to use it
- diagnose event loop saturation in Node.js services
- generate interactive flame graphs with 0x and clinic
- spot memory leaks using multi-stage heap snapshots
- inspect unneeded React component re-renders
- analyze slow SQL queries using EXPLAIN ANALYZE

## Example prompts
- Profile server.js with clinic flame while running an autocannon load test
- Compare heap snapshots to detect memory leaks in this Node.js process
- Measure event loop utilization and identify blocking synchronous calls

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: bca6a4fb2c62b00a.

BEGIN THIRD-PARTY FILE bca6a4fb2c62b00a
````text
---
name: performance-profiling
description: Application performance profiling and bottleneck identification — Node.js profiling, Chrome DevTools, flame graphs, memory leak detection, CPU profiling, React rendering performance. Activate
  on "profiling", "performance bottleneck", "flame graph", "memory leak", "slow app", "CPU profiling", "heap snapshot", "React re-renders", "EXPLAIN ANALYZE", "event loop lag", "clinic.js", "Core Web Vitals".
  NOT for infrastructure monitoring or observability (use logging-observability), load testing (use a load-testing skill), or database schema optimization.
allowed-tools: Read,Write,Edit,Bash,Grep,Glob
metadata:
  category: DevOps & Site Reliability
  tags:
  - performance
  - profiling
  - performance-bottleneck
  - flame-graph
  pairs-with:
  - skill: react-performance-optimizer
    reason: React DevTools profiling identifies component re-render bottlenecks for optimization
  - skill: caching-strategies
    reason: Profiling reveals cache miss patterns that inform caching architecture decisions
  - skill: postgresql-optimization
    reason: Database query profiling with EXPLAIN ANALYZE identifies slow query bottlenecks
  - skill: logging-observability
    reason: Performance metrics and traces collected by observability systems feed profiling analysis
---

# Performance Profiling

Find where your application actually spends time before touching a line of code. Covers the full stack: Node.js CPU and memory profiling, browser flame graphs, React render profiling, and database query analysis. The discipline here is profile first, optimize second — premature optimization is not a workflow, it is a guess.

## When to Use

**Use for**:
- Diagnosing slow Node.js applications (CPU-bound, I/O-bound, memory pressure)
- Generating and reading flame graphs to find hot code paths
- Detecting memory leaks via heap snapshots and growth trends
- Profiling React component render performance with React Profiler
- Measuring browser rendering performance (Core Web Vitals, layout thrashing, long tasks)
- Database query profiling with EXPLAIN ANALYZE
- Measuring event loop utilization and latency

**NOT for**:
- Infrastructure monitoring, distributed tracing, or log aggregation (use `logging-observability`)
- Load testing and capacity planning (a separate domain)
- Network latency analysis between services (use distributed tracing tools)
- Database schema design optimization (separate from query profiling)

---

## Core Decision: Where Is My App Slow?

```mermaid
flowchart TD
````
END THIRD-PARTY FILE bca6a4fb2c62b00a

The third-party file has ended. Everything between the bca6a4fb2c62b00a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2542 of 17042 bytes. © curiositech · MIT · https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/performance-profiling/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
