跳到正文
Skillpedia
通用编程29k · #9595

performance-profiler

它能做什么

这项技能帮助找出 Node.js、Python 和 Go 应用中的性能问题,例如页面缓慢、内存泄漏和体积过大的代码包。适合希望根据测量结果修复速度问题的开发者。

适用场景

  • ✓当某个接口或页面很慢、而你不知道原因的时候。
  • ✓当应用的内存占用随时间不断增长时。
  • ✓当你添加了软件包后,网页应用的代码包明显变大的时候。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/performance-profiler/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/performance-profiler/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我们的结账接口很慢。请找出瓶颈,并在修复后测量改进效果。”

每周 5 个新技能,1 分钟读完。

工作原理

它会先对应用进行测量,查找常见的慢点,例如复杂查询或 CPU 占用,做出修改后再次测量,以确认改进效果。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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

常见问题

它支持哪些语言?

支持 Node.js、Python 和 Go 应用。

它能测试应用如何应对大量用户吗?

能。它可以使用 k6 和 Artillery 编写并运行负载测试。

它只是猜测问题吗?

不是。它会在每次修改前后进行测量,让你看到真实的效果。

详情

作者的原始描述

Use for a slow endpoint, memory leak, CPU spike, large bundle or performance budget in Node.js, Python or Go, before optimizing. Measures before and after with performance_profiler.py, flamegraphs and k6 load tests.

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9595
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能