Datadog

How we built an async-aware Python profiler | Datadog

Sep 30, 2026Thomas Kowalski, Scott Gerring
How we built an async-aware Python profiler | Datadog
SummaryAI, from the source post

This post details the development of an async-aware Python profiler. It explains how asyncio's execution model (coroutines, tasks, event loop) differs from synchronous code, leading to flattened flame graphs that obscure task relationships. The solution reconstructs these relationships by tracking parent-child task dependencies and building a task dependency tree to create 'stacked stacks'. It also addresses edge cases like tasks outliving their creators and discusses overhead reduction techniques, achieving over 60% reduction.

More from the Java CPU Profiling trail