Home / Companies / Datadog / Blog / Post Details
Content Deep Dive

How we built an async-aware Python profiler

Blog post from Datadog

Post Details
Company
Date Published
Author
Thomas Kowalski, Scott Gerring
Word Count
4,226
Company Posts That Month
28
Language
English
Hacker News Points
-
Post removed?
No
Summary

Datadog redesigned its Python profiler to better analyze asyncio applications, where traditional flame graphs treat concurrent tasks as separate stacks and obscure the application paths responsible for work. The new async-aware model reconstructs task dependency relationships, creating “stacked stacks” that attribute activity such as database queries to the tasks awaiting them while accommodating tasks that outlive their creators. Because tracking every asyncio task substantially increased sampling costs, the team also optimized the profiler by removing exceptions from the sampling path, interning repeated strings, and replacing costly process_vm_readv memory reads with protected memcpy operations that safely recover from rare memory-access faults. These changes reduced profiler overhead by more than 60% in deployed services, enabled higher sampling fidelity, and helped identify production issues including an infinite decompression loop, wasteful logging string construction, and inefficient numerical code. The async-aware profiling and lower-overhead improvements are available in recent ddtrace versions.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
LLM 3 747 162 79 -85%
MCP 2 2,241 148 72 -74%
AI Agents 1 931 231 103 -84%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.