← Back to release summary

PerformanceObserverInit buffered flag

Category
Performance
Type
New or changed feature
Status
Enabled by default (Chrome 77)
Intent stage
Evaluate readiness to ship

Summary

Adds a buffered flag to observer.observe() so that PerformanceObserver can receive entries created before the call is executed.

Motivation

We want to encourage using the PerformanceObserver because polling is more expensive and we have greater control over when PerformanceObserver callbacks occur. However, currently entries that were created before the observer begins observing are not reachable, thus creating a gap between start of page load and observer creation. The buffered flag solves that gap by enabling observers to access entries from before the observer creation. This way, we do not incentivize running a performance-related script very early during page load just so that some information is not missed.

Standards & signals

Docs: N/A

Explainers: https://w3c.github.io/performance-timeline/#introduction

View on chromestatus.com