Skip to content
Datadog

How we built an async-aware Python profiler | Datadog

Sep 30, 2026Thomas Kowalski, Scott Gerring23 min read
Opens datadoghq.com
What the post coversAI, 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.
Read the full post on datadoghq.com · 23 min (opens in a new tab)

More from the Java CPU Profiling trail