w3c / performance-timeline

Performance Timeline
https://w3c.github.io/performance-timeline/
Other
111 stars 27 forks source link

When should a UA clear its entry buffers? #178

Closed sefeng211 closed 3 years ago

sefeng211 commented 3 years ago

The spec doesn't specify when a UA should clear the entry buffers.

Say the page has been running for days, should the UA be able to clear the entry buffers since the cached buffers are likely no longer useful?

This is somewhat related to #101, however, #101 is more specific about under memory pressure condition.

@smaug---- @npm1

smaug---- commented 3 years ago

FWIW, I was asking this question from @sefeng211 in the context of PerformanceEventTiming.

npm1 commented 3 years ago

Sorry for missing the ping here @sefeng211

We discussed in the call. The idea is that the size-bounded buffers* are used to keep track of initial entries, while analytics has the chance to register PerformanceObservers. So there is no need to clear these buffers. There's a question around whether it's worth clearing them when certain conditions are met and we are 'confident' that the data won't be used, but I don't think we reached consensus on a reasonable heuristic here and any such heuristic could hurt developer expectations due to increased inconsistency. Closing but let me know if I missed something.