Performance Profiler
Tier: POWERFUL
Category: Engineering
Domain: Performance Engineering
Overview
Systematic performance profiling for Node.js, Python, and Go applications. Identifies CPU, memory, and I/O bottlenecks; generates flamegraphs; analyzes bundle sizes; optimizes database queries; detects memory leaks; and runs load tests with k6 and Artillery. Always measures before and after.
Core Capabilities
- CPU profiling — flamegraphs for Node.js, py-spy for Python, pprof for Go
- Memory profiling — heap snapshots, leak detection, GC pressure
- Bundle analysis — webpack-bundle-analyzer, Next.js bundle analyzer
- Database optimization — EXPLAIN ANALYZE, slow query log, N+1 detection
- Load testing — k6 scripts, Artillery scenarios, ramp-up patterns
- Before/after measurement — establish baseline, profile, optimize, verify
When to Use
- App is slow and you don't know where the bottleneck is
- P99 latency exceeds SLA before a release
- Memory usage grows over time (suspected leak)
- Bundle size increased after adding dependencies
- Preparing for a traffic spike (load test before launch)
- Database queries taking >100ms
Quick Start
# Analyze a project for performance risk indicators
python3 scripts/performance_profiler.py /path/to/project
# JSON output for CI integration
python3 scripts/performance_profiler.py /path/to/project --json
# Custom large-file threshold
python3 scripts/performance_profiler.py /path/to/project --large-file-threshold-kb 256
Golden Rule: Measure First
# Establish baseline BEFORE any optimization
# Record: P50, P95, P99 latency | RPS | error rate | memory usage
# Wrong: "I think the N+1 query is slow, let me fix it"
# Right: Profile → confirm bottleneck → fix → measure again → verify improvement
Node.js Profiling
→ See references/profiling-recipes.md for details
References
- references/profiling-recipes.md — Node.js/Python/Go profiling commands, flamegraph generation, heap snapshots
- references/optimization-playbook.md — before/after measurement template, quick-win optimization checklist (DB/Node/bundle/API), common pitfalls, best practices
1---
2name: performance-profiler
3description: "Systematic performance profiling for Node.js, Python, and Go applications. Identifies CPU, memory, and I/O bottlenecks, generates flamegraphs, analyzes bundle sizes, optimizes database queries, runs load tests with k6 and Artillery. Always measure..."
4version: 1.0.0
5author:
6 name: "Alireza Rezvani"
7 github: alirezarezvani
8tags: [performance, profiler]
9category: engineering
10platforms: [macos, linux, windows]
11license: MIT
12metadata:
13 hermes:
14 related_skills: [performance, profiler]
15 source: https://skillmd.com/skills/nous-hermeshub/performance-profiler
16 upstream: "claude-skills"
17 original_author: "Alireza Rezvani"
18---
19
20# Performance Profiler
21
22**Tier:** POWERFUL
23**Category:** Engineering
24**Domain:** Performance Engineering
25
26---
27
28## Overview
29
30Systematic performance profiling for Node.js, Python, and Go applications. Identifies CPU, memory, and I/O bottlenecks; generates flamegraphs; analyzes bundle sizes; optimizes database queries; detects memory leaks; and runs load tests with k6 and Artillery. Always measures before and after.
31
32## Core Capabilities
33
34- **CPU profiling** — flamegraphs for Node.js, py-spy for Python, pprof for Go
35- **Memory profiling** — heap snapshots, leak detection, GC pressure
36- **Bundle analysis** — webpack-bundle-analyzer, Next.js bundle analyzer
37- **Database optimization** — EXPLAIN ANALYZE, slow query log, N+1 detection
38- **Load testing** — k6 scripts, Artillery scenarios, ramp-up patterns
39- **Before/after measurement** — establish baseline, profile, optimize, verify
40
41---
42
43## When to Use
44
45- App is slow and you don't know where the bottleneck is
46- P99 latency exceeds SLA before a release
47- Memory usage grows over time (suspected leak)
48- Bundle size increased after adding dependencies
49- Preparing for a traffic spike (load test before launch)
50- Database queries taking >100ms
51
52---
53
54## Quick Start
55
56```bash
57# Analyze a project for performance risk indicators
58python3 scripts/performance_profiler.py /path/to/project
59
60# JSON output for CI integration
61python3 scripts/performance_profiler.py /path/to/project --json
62
63# Custom large-file threshold
64python3 scripts/performance_profiler.py /path/to/project --large-file-threshold-kb 256
65```
66
67---
68
69## Golden Rule: Measure First
70
71```bash
72# Establish baseline BEFORE any optimization
73# Record: P50, P95, P99 latency | RPS | error rate | memory usage
74
75# Wrong: "I think the N+1 query is slow, let me fix it"
76# Right: Profile → confirm bottleneck → fix → measure again → verify improvement
77```
78
79---
80
81## Node.js Profiling
82→ See references/profiling-recipes.md for details
83
84## References
85
86- [references/profiling-recipes.md](references/profiling-recipes.md) — Node.js/Python/Go profiling commands, flamegraph generation, heap snapshots
87- [references/optimization-playbook.md](references/optimization-playbook.md) — before/after measurement template, quick-win optimization checklist (DB/Node/bundle/API), common pitfalls, best practices