Generated banner for Workers Profiling
Generated logo for Workers Profiling

Workers Profiling

CloudflareOfficialPublished by Cloudflare

  • Skill
  • Review and audit
  • Cloud and DevOps
  • Apache-2.0
  • No issues found

From the author

Profile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code.
— the description by Cloudflare

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to identifying and resolving performance bottlenecks in deployed Cloudflare Workers and Durable Objects. It guides users through capturing CPU and heap profiles, analyzing the resulting pprof files for hotspots, and mapping those findings back to source code to implement targeted optimizations.

What it does

  • Identifies performance symptoms like high CPU usage, latency, or memory growth.
  • Captures CPU and heap profiles from deployed Workers and Durable Objects.
  • Analyzes pprof files to pinpoint function-level hotspots.
  • Maps performance data to source code locations for easier debugging.
  • Recommends actionable code changes to resolve identified performance issues.
  • Provides a feedback loop for reporting skill inaccuracies or improvements.

When to use it

  • When a Worker or Durable Object experiences unexpected latency or high CPU usage.
  • When investigating memory leaks or high allocation pressure in production.
  • When you need to optimize specific functions within your serverless code.
  • When you have captured a profile and need help interpreting the results.

Advantages

  • Enables data-driven performance tuning based on actual production metrics.
  • Provides a clear, step-by-step workflow for complex profiling tasks.
  • Helps bridge the gap between raw pprof data and actionable code improvements.
  • Supports source map integration to make profiling data human-readable.

Usage examples

“My Worker is hitting CPU limits, how can I find the cause?”
The agent will guide you through identifying the affected Worker, capturing a CPU profile, and analyzing the pprof file to find the specific functions consuming the most resources.
“I have a memory leak in my Durable Object, what should I do?”
The agent will assist you in capturing a heap profile to identify memory allocation hotspots and suggest code changes to reduce memory pressure.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/cloudflare/workers-profiling/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip workers-profiling.zip -d .agents/skills

Documentation by Cloudflare

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.

Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Cloudflare
Publisher
Cloudflare (Official)
Source
cloudflare/skills · skills/workers-profiling · commit 6eb6c78
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Cloudflare or Cloudflare.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download workers-profiling.zip