Delayed Message Timing API
- Category
- Performance
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Web applications frequently use the postMessage API for communication across different execution contexts, such as between windows, iframes, and web workers. However, message delays often occur when messages are queued but not processed promptly. These delays can degrade the user experience by making applications feel unresponsive. While developers can detect that a delay happened, identifying the specific cause—whether it's a busy thread, a congested message queue, or serialization/deserialization overhead—is challenging with current tools. The Delayed Message Timing API will provide developers with end-to-end timing metrics and details on blocking tasks, allowing them to pinpoint the root causes of these delays and improve application performance.
Motivation
The web needs the Delayed Message Timing API because web applications frequently use postMessage, but the resulting message delays can significantly degrade user experience. While developers can currently detect these delays, they lack the tools to accurately diagnose their root cause. Delays can stem from a variety of sources, including a receiver's thread being busy with long tasks, congestion in the message queue, or serialization/deserialization overhead. Manually measuring these internal timings with existing tools is often imprecise and cumbersome. A dedicated API is therefore necessary to precisely measure and attribute these specific sources of delay. Without it, web developers face considerable challenges in identifying and resolving these critical performance issues, leading to a poorer experience for end-users.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/u/1/issues/437952019
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=delayed-message-timing-api
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Delayed%20Message%20Timing%20API
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Delayed%20Message%20Timing%20API
- Baseline status: https://webstatus.dev/?q=Delayed%20Message%20Timing%20API
Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DelayedMessages/explainer.md