Workers Profiling

cloudflare/skills/skills/workers-profiling

作者 cloudflare49a31e0b3229ccdffe4944be9c61bc7481d1d432无许可证3.2K 个星标收录于 2026年10月11日更新于 2026年10月28日仓库今天更新

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.

Skill feedback

If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md [blocked].

来源与署名

来源:cloudflare/skills位于skills/workers-profiling提交49a31e0

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

在 README 中添加徽章

向读者展示该技能已收录于 SourceWeft,徽章链接到本页。

“Listed on SourceWeft”徽章预览
[![Listed on SourceWeft](https://sourceweft.com/badge/skills/gh-cloudflare-skills-workers-profiling-skills-workers-profiling-3f3516f6df1a5284.svg)](https://sourceweft.com/skills/gh-cloudflare-skills-workers-profiling-skills-workers-profiling-3f3516f6df1a5284?utm_source=readme&utm_medium=badge)

举报或申请下架