Cloudflare has rolled out on-demand CPU and memory profiling for Workers and Durable Objects, enabling developers to hunt down performance issues in production environments using interactive flamegraphs. Revealed on October 9, 2026, the capability lets teams capture CPU or heap-allocation profiles for a deployed Worker version and examine the findings as a flamegraph, where broader sections represent functions consuming a larger portion of CPU time or sampled memory allocations. The feature targets already-running isolates rather than launching fresh ones, permitting developers to study code running under actual production traffic.

Using the capability internally, Cloudflare discovered unnecessary computation and memory consumption in its own infrastructure. Profiling an R2 binding Worker uncovered a recursive JSON replacer that repeatedly walked through nested data, causing the function to execute redundant operations; fixing the code reportedly made it 2.7 times faster. A separate profile identified an unneeded duplicate metrics call that consumed roughly 1% of CPU time. Memory profiling revealed that partially disabled Prometheus instrumentation was still eating substantial memory; removing the leftover code brought the Worker's 99.9th-percentile memory consumption down from 133 MB to 118 MB, dropping it below the 128 MB threshold.

The platform distinguishes between CPU and memory profiles by targeting different resource bottlenecks. According to the report, CPU profiling samples call stacks to show where execution time is spent, helping locate expensive functions, redundant computation, and potential optimization opportunities, while memory profiling highlights allocations tied to functions, helping developers find code that generates excessive objects or adds to memory pressure. For CPU profiling, the runtime launches a V8 profiler that samples at one-millisecond intervals, releases the lock while requests keep running, and reacquires it to halt profiling and gather results, letting the platform watch live execution without pausing normal request handling during capture. Durable Objects receive extra support for profiling a specific named instance, useful when investigating problems linked to stateful workloads, though the target must get enough traffic during the capture window.

The feature addresses a practical gap between detecting slowdowns and pinpointing the responsible code. Chrome DevTools supports local CPU profiling during development, but recreating production traffic and data can be challenging, while pprof offers robust offline profile analysis for Go and other workflows; Cloudflare's main edge is the ability to trigger profiling against live Workers and Durable Objects through the platform's existing operational interface. The capability works alongside logs, metrics, and distributed tracing, which help spot when a service is slow or consuming too many resources, while a profile can help zero in on the functions at fault. Cloudflare notes it's working toward continuous profiling, which could simplify investigating rare performance problems without needing to predict when they'll happen. For teams operating production workloads on Cloudflare Workers, the release provides a concrete debugging tool that bridges the distance from noticing resource strain to identifying the exact code behind it, without first needing to replicate the problem locally. The shift from reactive monitoring to targeted production diagnosis reflects a broader expectation that observability platforms must surface actionable insights at the function level, not just aggregate signals, particularly as serverless architectures distribute state and execution across geographies in ways that make local reproduction increasingly impractical.