Cloudflare can now profile a pull request before you merge it
Worker Previews get CPU and heap profiling, so a flamegraph shows what a branch costs before it reaches production. Cloudflare pitches it partly as a loop for coding agents.
Cloudflare added CPU and heap profiling to Worker Previews on 23 November, letting you see what a pull request costs before it merges. Send traffic to a Preview deployment, then capture a profile to see which functions in the branch use the most CPU time or memory, viewed as a flamegraph or table, or downloaded as a raw pprof file.
Each Preview gets its own Durable Object namespaces, so a specific Durable Object can be profiled by ID on the branch the same way it would be in production, while production itself stays untouched throughout. Profiling can be triggered from the dashboard’s Observability tab, the Cloudflare CLI, or the API.
cf previews deployments profile latest --worker my-worker --profile-type cpu
Cloudflare also pitches this as infrastructure for coding agents: Claude, Codex, Cursor and OpenCode are named as able to deploy, load-test, profile, rewrite the hot function and redeploy in a loop, with each deployment keeping its own ID so a profile maps back to an exact version.
Why it matters: performance regressions in Workers usually surface after merge, in production metrics or a billing surprise. Profiling the preview instead turns CPU and memory cost into something you check in review, the same way you’d check a diff or a test run.