dev-loop-performance-profiler
Use when the user asks to profile slow code, find a CPU or memory bottleneck, read a flame graph, use pprof, py-spy, perf or Chrome DevTools profiler, or…
от j4flmao★ 47 звёзд на GitHub
Установить dev-loop-performance-profiler в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Performance Profiler
Purpose
Identify, analyze, and resolve performance bottlenecks in applications — CPU profiling, memory profiling, I/O analysis, database query optimization, and frontend rendering performance — using systematic measurement and optimization.
Agent Protocol
Trigger
Exact user phrases: "performance profiling", "profiling", "slow application", "performance bottleneck", "CPU profiler", "memory leak", "heap dump", "database slow query", "performance optimization", "flame graph", "page speed", "LCP", "INP", "CLS".
Input Context
- Performance symptom (slow response, high CPU, memory growth, network latency, UI jank)
- Application type (web frontend, API server, database, desktop, mobile)
- Environment (local development, staging, production, specific user)
- Scale (single user, concurrent, burst traffic, sustained load)
- Recent changes (deployment, dependency update, config change, migration)
- Available tools (built-in profiler, APM, browser DevTools, database tools)
Output Artifact
Performance analysis report with measured metrics, bottleneck identification, and optimized code.
Response Format
Symptom + baseline: {metric, value, environment}
Tool: {profiler/APM/DevTools}
Hot spots: {function/query/resource -> % time or bytes}
Root cause: {explanation}
Fix: {change}
Result: {before -> after, same workload}
Completion Criteria
- Baseline performance metrics established
- Profiling tool selected and configured
- CPU/memory/IO hot spots identified
- Root cause of bottleneck documented
- Optimization implemented and measured
- Improvement verified with before/after metrics
- Regression benchmark added
- Monitoring alert configured (if in production)
Max Response Length
200 lines.
Framework/Methodology
Performance Analysis Decision Tree
What is the performance symptom?
├── Slow API response time → Server-side profiling
│ → APM (DataDog, New Relic) → flame graph → database query analysis
│ → Cache strategy → N+1 query → index → pagination
├── High CPU usage → CPU profiling
│ → Sampling profiler → hot functions → algorithm optimization
│ → Worker threads → microservices → resource limits
├── Memory growth / leak → Memory profiling
│ → Heap dump → retained size → leak suspect → fix
│ → Event listener cleanup → cache size → object pooling
├── Slow page load (frontend) → Browser DevTools
│ → Lighthouse → Largest Contentful Paint → bundle analysis
│ → Code splitting → image optimization → lazy loading
├── Slow database queries → Query profiling
│ → EXPLAIN ANALYZE → missing index → full table scan
│ → Query rewrite → denormalization → read replica
└── Network latency → Request waterfall
→ Waterfall chart → CDN → compression → HTTP/2 → prefetch
Performance Optimization Process
1. MEASURE → Establish baseline (not assumptions!)
2. IDENTIFY → Find the bottleneck (not everything is slow)
3. ANALYZE → Understand WHY it's slow
4. OPTIMIZE → Make targeted change (one change at a time)
5. MEASURE → Verify improvement (same conditions as baseline)
6. REPEAT → Find next bottleneck
Amdahl's Law
Speedup = 1 / ((1 - P) + (P/S))
Where P = proportion of execution time improved
S = speedup of that portion
Key insight: Optimize what matters most. A 10x improvement on 5% of execution
time only yields 4.7% overall speedup.
Workflow
Step 1: Profile CPU (Server-Side)
# Node.js: built-in profiler
node --prof app.js
node --prof-process isolate-*.log > processed.txt
# Node.js: clinic.js (flame graphs)
npx clinic doctor -- node app.js
npx clinic flame -- node app.js
# Python: cProfile
python -m cProfile -o output.prof app.py
python -m pstats output.prof # Interactive analysis
# Or use snakeviz for visualization: snakeviz output.prof
# Rust: perf + flamegraph
perf record --call-graph dwarf target/release/myapp
perf script | inferno-collapse-perf > stacks.folded
inferno-flamegraph stacks.folded > flamegraph.svg
# C# / .NET: dotnet-counters + dotnet-trace
dotnet-counters monitor --process-id <pid>
dotnet-trace collect --process-id <pid> --providers Microsoft-DotNETCore-SampleProfiler
Step 2: Profile Memory
// Node.js: heap snapshot
import * as v8 from 'v8';
import * as fs from 'fs';
// Take heap snapshot programmatically
const snapshot = v8.getHeapSnapshot();
snapshot.pipe(fs.createWriteStream('heap.heapsnapshot'));
// Open in Chrome DevTools → Memory → Load
// Track memory over time
setInterval(() => {
const usage = process.memoryUsage();
console.log({
rss: `${(usage.rss / 1024 / 1024).toFixed(1)} MB`, // Resident Set Size
heapTotal: `${(usage.heapTotal / 1024 / 1024).toFixed(1)} MB`,
heapUsed: `${(usage.heapUsed / 1024 / 1024).toFixed(1)} MB`,
external: `${(usage.external / 1024 / 1024).toFixed(1)} MB`,
});
}, 5000);
# Python: memory profiler
from memory_profiler import profile
@prof
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/bottleneck-analysis-2.md
- references/bottleneck-analysis.md
- references/bottleneck-patterns.md
- references/performance-profiler-advanced.md
- references/performance-profiler-fundamentals.md
- references/profiling-tools-2.md
- references/profiling-tools-comparison.md
- references/profiling-tools.md
FAQ
Что делает скилл dev-loop-performance-profiler?
Use when the user asks to profile slow code, find a CPU or memory bottleneck, read a flame graph, use pprof, py-spy, perf or Chrome DevTools profiler, or chase a memory leak or high latency. Produces a measure-first profiling plan and targeted optimizations. Not for functional bugs (use dev-loop-debugging-strategy) or load tests (use quality-load-testing).
Как установить скилл dev-loop-performance-profiler?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dev-loop-performance-profiler запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…