performance-engineer by 404kidwiz/claude-supercode-skills
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill performance-engineer提供系统优化和性能分析专业知识,专注于使用 eBPF 和火焰图进行深度性能分析、负载测试和内核级调优。识别并解决应用程序和基础设施中的性能瓶颈。
What is the bottleneck?
│
├─ **CPU High?**
│ ├─ User Space? → **Language Profiler** (pprof, async-profiler)
│ └─ Kernel Space? → **perf / eBPF** (System calls, Context switches)
│
├─ **Memory High?**
│ ├─ Leak? → **Heap Dump Analysis** (Eclipse MAT, heaptrack)
│ └─ Fragmentation? → **Allocator tuning** (jemalloc, tcmalloc)
│
├─ **I/O Wait?**
│ ├─ Disk? → **iostat / biotop**
│ └─ Network? → **tcpdump / Wireshark**
│
└─ **Latency (Wait Time)?**
└─ Distributed? → **Tracing** (OpenTelemetry, Jaeger)
| 工具 | 语言 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 最佳适用场景 |
|---|
| K6 | JS | 对开发者友好,易于 CI/CD 集成。 |
| Gatling | Scala/Java | 高并发,复杂场景。 |
| Locust | Python | 快速原型设计,基于代码的测试。 |
| Wrk2 | C | 原始 HTTP 吞吐量基准测试(简单)。 |
危险信号 → 升级给 database-optimizer:
目标: 确定哪个函数消耗了 80% 的 CPU。
步骤:
捕获性能分析数据(Linux perf)
# Record stack traces at 99Hz for 30 seconds
perf record -F 99 -a -g -- sleep 30
生成火焰图
perf script > out.perf
./stackcollapse-perf.pl out.perf > out.folded
./flamegraph.pl out.folded > profile.svg
分析
profile.svg。json_parse 宽度占 40% → 优化 JSON 处理。目标: 提高前端响应能力(核心 Web 指标)。
步骤:
await new Promise(r => setTimeout(r, 0)) 或 scheduler.postTask()。目标: 修复 React 按钮上的"点击卡顿"(INP > 200ms)。
步骤:
识别交互
click 处理程序的持续时间。拆分长任务
async function handleClick() {
// 1. UI Update (Immediate)
setLoading(true);
// 2. Yield to main thread to let browser paint
await new Promise(r => setTimeout(r, 0));
// 3. Heavy Logic
await heavyCalculation();
setLoading(false);
}
验证
Web Vitals 扩展。检查 INP 是否降至 200ms 以下。表现:
map() 替换为复杂的 for 循环,因为"它更快"。失败原因:
正确方法:
表现:
失败原因:
正确方法:
表现:
失败原因:
正确方法:
场景: 生产环境 API 出现 80% CPU 利用率,导致延迟尖峰。
调查方法:
关键发现:
| 函数 | CPU % | 优化措施 |
|---|---|---|
| json_serialize | 35% | 切换到二进制格式 |
| crypto_hash | 25% | 批量哈希操作 |
| regex_match | 20% | 预编译模式 |
结果:
场景: 包含 15 个服务的分布式系统出现端到端延迟问题。
调查方法:
追踪分析:
Service A (50ms) → Service B (200ms) → Service C (500ms) → Database (1s)
↑
Connection pool exhaustion
解决方案:
结果:
场景: 电子商务平台为黑色星期五流量(正常负载的 10 倍)做准备。
负载测试方法:
负载测试结果:
| 虚拟用户数 | RPS | P95 延迟 | 错误率 |
|---|---|---|---|
| 1,000 | 500 | 150ms | 0.1% |
| 5,000 | 2,400 | 280ms | 0.3% |
| 10,000 | 4,800 | 550ms | 1.2% |
| 15,000 | 6,200 | 1.2s | 5.8% |
容量建议:
性能分析:
负载测试:
优化:
每周安装量
80
仓库
GitHub 星标数
42
首次出现
2026年1月24日
安全审计
安装于
opencode68
codex62
gemini-cli62
cursor59
claude-code59
github-copilot55
Provides system optimization and profiling expertise specializing in deep-dive performance analysis, load testing, and kernel-level tuning using eBPF and Flamegraphs. Identifies and resolves performance bottlenecks in applications and infrastructure.
What is the bottleneck?
│
├─ **CPU High?**
│ ├─ User Space? → **Language Profiler** (pprof, async-profiler)
│ └─ Kernel Space? → **perf / eBPF** (System calls, Context switches)
│
├─ **Memory High?**
│ ├─ Leak? → **Heap Dump Analysis** (Eclipse MAT, heaptrack)
│ └─ Fragmentation? → **Allocator tuning** (jemalloc, tcmalloc)
│
├─ **I/O Wait?**
│ ├─ Disk? → **iostat / biotop**
│ └─ Network? → **tcpdump / Wireshark**
│
└─ **Latency (Wait Time)?**
└─ Distributed? → **Tracing** (OpenTelemetry, Jaeger)
| Tool | Language | Best For |
|---|---|---|
| K6 | JS | Developer-friendly, CI/CD integration. |
| Gatling | Scala/Java | High concurrency, complex scenarios. |
| Locust | Python | Rapid prototyping, code-based tests. |
| Wrk2 | C | Raw HTTP throughput benchmarking (simple). |
Red Flags → Escalate todatabase-optimizer:
Goal: Identify which function is consuming 80% CPU.
Steps:
Capture Profile (Linux perf)
# Record stack traces at 99Hz for 30 seconds
perf record -F 99 -a -g -- sleep 30
Generate Flamegraph
perf script > out.perf
./stackcollapse-perf.pl out.perf > out.folded
./flamegraph.pl out.folded > profile.svg
Analysis
profile.svg in browser.json_parse is 40% width → Optimize JSON handling.Goal: Improve Frontend responsiveness (Core Web Vital).
Steps:
Measure
Identify
Optimize
await new Promise(r => setTimeout(r, 0)) or scheduler.postTask().Goal: Fix "Laggy Click" (INP > 200ms) on a React button.
Steps:
Identify Interaction
click handler duration.Break Up Long Tasks
async function handleClick() {
// 1. UI Update (Immediate)
setLoading(true);
// 2. Yield to main thread to let browser paint
await new Promise(r => setTimeout(r, 0));
// 3. Heavy Logic
await heavyCalculation();
setLoading(false);
}
Verify
Web Vitals extension. Check if INP drops below 200ms.What it looks like:
map() with a complex for loop because "it's faster" without measuring.Why it fails:
Correct approach:
What it looks like:
Why it fails:
Correct approach:
What it looks like:
Why it fails:
Correct approach:
Scenario: Production API experiencing 80% CPU utilization causing latency spikes.
Investigation Approach:
Key Findings:
| Function | CPU % | Optimization Action |
|---|---|---|
| json_serialize | 35% | Switch to binary format |
| crypto_hash | 25% | Batch hashing operations |
| regex_match | 20% | Pre-compile patterns |
Results:
Scenario: Distributed system with 15 services experiencing end-to-end latency issues.
Investigation Approach:
Trace Analysis:
Service A (50ms) → Service B (200ms) → Service C (500ms) → Database (1s)
↑
Connection pool exhaustion
Resolution:
Results:
Scenario: E-commerce platform preparing for Black Friday traffic (10x normal load).
Load Testing Approach:
Load Test Results:
| Virtual Users | RPS | P95 Latency | Error Rate |
|---|---|---|---|
| 1,000 | 500 | 150ms | 0.1% |
| 5,000 | 2,400 | 280ms | 0.3% |
| 10,000 | 4,800 | 550ms | 1.2% |
| 15,000 | 6,200 | 1.2s | 5.8% |
Capacity Recommendations:
Profiling:
Load Testing:
Optimization:
Weekly Installs
80
Repository
GitHub Stars
42
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode68
codex62
gemini-cli62
cursor59
claude-code59
github-copilot55
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
94,100 周安装