Skip to main content

workers-profiling

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

소스 정보

저장소
cloudflare/skills
최근 소스 활동
2026년 10월 15일 19:45
감지된 SKILL.md 언어
영어
스타
3,070
포크
315

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
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](https://developers.cloudflare.com/workers/observability/profiling-in-production/index.md) 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](https://developers.cloudflare.com/cf/index.md) 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.
GitHub에서 보기