workers-profiling

GitHub

用于分析 Cloudflare Workers 和 Durable Objects 的 CPU 及内存性能瓶颈,通过 pprof 数据定位热点代码,并提出最小化优化方案以提升部署代码效率。

.claude/skills/workers-profiling/SKILL.md NYLLON-SOFTWARE/ember-cloudflare

触发场景

需要分析已部署 Worker 的高 CPU 或内存占用问题 请求对 Durable Objects 进行性能剖析 希望优化代码以解决延迟或分配压力

安装

npx skills add NYLLON-SOFTWARE/ember-cloudflare --skill workers-profiling -g -y
更多选项

非标准路径

npx skills add https://github.com/NYLLON-SOFTWARE/ember-cloudflare/tree/main/.claude/skills/workers-profiling -g -y

不安装直接使用

npx skills use NYLLON-SOFTWARE/ember-cloudflare@workers-profiling

指定 Agent (Claude Code)

npx skills add NYLLON-SOFTWARE/ember-cloudflare --skill workers-profiling -a claude-code -g -y

安装 repo 全部 skill

npx skills add NYLLON-SOFTWARE/ember-cloudflare --all -g -y

预览 repo 内 skill

npx skills add NYLLON-SOFTWARE/ember-cloudflare --list

SKILL.md

Frontmatter
{
    "name": "workers-profiling",
    "description": "Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code."
}

Workers profiling

Find expensive functions or memory allocations in deployed code and come up with ways to fix them.

Retrieve the docs

Start with the production profiling guide to understand how Workers and Durable Objects profiling works.

Profiling steps

  1. Identify the symptom and affected workload: CPU usage, latency, allocation pressure, or memory growth.
  2. Confirm the account, Worker, environment, and deployed version with the user.
  3. For a Durable Object, also confirm its owning Worker, namespace, and instance.
  4. Choose CPU or heap profiling from the current guide's supported types and meanings.

Where possible, use the cf CLI to capture profiles. If the user requests cf, inspect the installed version's command help and schema where available.

If cf isn't available, consider prompting the user whether they would like to install it.

The profiling API will return a pprof file which you can analyze directly, or using appropriate tools like Go's pprof utility.

Inspect the evidence

  • Read the pprof file and analyse it for hotspots
  • Map hotspots to functions and source locations when evidence supports it; report missing symbols or source mappings.
  • If filenames and function names are pointing at the generated JavaScript, consider suggesting to the user to enable source maps and re-do the profiling.

Optimise

Propose the smallest code change supported by the capture which resolves the issues identified.

Report findings

Return a concise report with:

  • Evidence for each finding: file, function, source location, and metric with units, where available.
  • The smallest actionable change and how to check its effect.

版本历史

  • d8417d2 当前 2026-11-13 18:23

同 Skill 集合

.claude/skills/cloudflare/SKILL.md
.claude/skills/core-web-vitals/SKILL.md
.claude/skills/durable-objects/SKILL.md
.claude/skills/performance/SKILL.md
.claude/skills/vercel-react-best-practices/SKILL.md
.claude/skills/web-perf/SKILL.md
.claude/skills/workers-best-practices/SKILL.md
.claude/skills/wrangler/SKILL.md

元信息

文件数
0
版本
937420a
Hash
fd608bf7
收录时间
2026-11-13 18:23

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-14 02:24
浙ICP备14020137号-1