
Performance Profiler
Find CPU, memory, I/O, bundle, and database bottlenecks with measured before/after profiling and load tests before you ship or scale traffic.
Overview
Performance Profiler is an agent skill most often used in Ship (also Operate) that profiles CPU, memory, I/O, bundles, and databases with before/after measurement.
Install
npx skills add https://github.com/alirezarezvani/claude-skills --skill performance-profilerWhat is this skill?
- CPU profiling: flamegraphs (Node), py-spy (Python), pprof (Go)
- Memory: heap snapshots, leak detection, GC pressure analysis
- Bundle analysis via webpack-bundle-analyzer and Next.js bundle tools
- Database: EXPLAIN ANALYZE, slow query log, N+1 detection
- Load testing with k6 and Artillery plus a Python project scanner script
- 6 core capability areas: CPU, memory, bundle, database, load testing, before/after measurement
- References queries slower than 100ms as a trigger
Adoption & trust: 562 installs on skills.sh; 17.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your app is slow or memory-hungry and you do not know whether CPU, queries, bundles, or load limits are the real bottleneck.
Who is it for?
Indie backends and fullstack apps facing SLA pressure, traffic spikes, or regressions after dependency changes.
Skip if: Greenfield prototypes with no users yet where premature optimization would distract from validation.
When should I use this skill?
App is slow, P99 exceeds SLA, memory grows over time, bundle size regressed, or you need load tests before a traffic spike.
What do I get? / Deliverables
You get a profiling plan, tool-specific captures, optimization targets, and verified before/after metrics including optional load-test scripts.
- Profiling reports and flamegraph guidance
- Optimization recommendations with before/after numbers
- k6 or Artillery load-test scenarios
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Ship perf is the primary shelf for release-gate work: P99 SLAs, bundle regressions, and pre-launch load tests. Perf subphase covers systematic profiling, flamegraphs, heap analysis, and k6/Artillery scenarios—not one-off log grepping.
Where it fits
P99 latency fails an SLA gate days before shipping a pricing change.
Run k6 ramp-up to see if the API survives a Product Hunt spike.
Weekly memory growth suggests a leak—capture heap snapshots and compare.
How it compares
Structured profiling playbook—not a substitute for production APM unless you run its measurement steps.
Common Questions / FAQ
Who is performance-profiler for?
Solo engineers shipping Node, Python, or Go services who need repeatable profiling and load tests without hiring a performance specialist.
When should I use performance-profiler?
In Ship perf before release when P99 exceeds SLA; in Ship testing for load spikes; in Operate iterate when memory grows or queries degrade in production.
Is performance-profiler safe to install?
Review Security Audits on this page; profiling may require shell access to run scripts, py-spy, pprof, k6, or Artillery locally.
SKILL.md
READMESKILL.md - Performance Profiler
# 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 ```bash # 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 ```bash # 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 ## Before/After Measurement Template ```markdown ## Performance Optimization: [What You Fixed] **Date:** 2026-03-01 **Engineer:** @username **Ticket:** PROJ-123 ### Problem [1-2 sentences: what was slow, how was it observed] ### Root Cause [What the profiler revealed] ### Baseline (Before) | Metric | Value | |--------|-------| | P50 latency | 480ms | | P95 latency | 1,240ms | | P99 latency | 3,100ms | | RPS @ 50 VUs | 42 | | Error rate | 0.8% | | DB queries/req | 23 (N+1) | Profiler evidence: [link to flamegraph or screenshot] ### Fix Applied [What changed — code diff or description] ### After | Metric | Before | After | Delta | |--------|--------|-------|-------| | P50 latency | 480ms | 48ms | -90% | | P95 latency | 1,240ms | 120ms | -90% | | P99 latency | 3,100ms | 280ms | -91% | | RPS @ 50 VUs | 42 | 380 | +804% | | Error rate | 0.8% | 0% | -100% | | DB queries/req | 23 | 1 | -96% | ### Verification Load test run: [link to k6 output] ``` --- ## Optimization Checklist ### Quick wins (check these first) ``` Database □ Missing indexes on WHERE/ORDER BY columns □ N+1 queries (check query count per request) □ Loading all columns when only 2-3 needed (SELECT *) □ No LIMIT on unbounded queries □ Missing connection pool (creating new connection per request) Node.js □ Sync I/O (fs.readFileSync) in hot path □ JSON.parse/stringify of large objects in hot loop □ Missing caching for expensive computations □ No compression (gzip/brotli) on responses □ Dependencies loaded in request handler (move to module level) Bundle □ Moment.js → dayjs/date-fns □ Lodash (full) → lodash/function imports □ Static imports of heavy components → dynamic imports □ Images not optimized / not using next/image □ No code splitting on routes API □ No pagination on list endpoints □ No response caching (Cache-Control headers) □ Serial awaits that could be parallel (Promise.all) □ Fetching related data in a loop instead of JOIN ``` --- ## Common Pitfalls - **Optimiz