-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define buffering behaviors & hooks for queued (PerformanceObserver) entries #81
Comments
Based on the discussion at the WebPerf F2F, we converged on:
Does that sound correct? Assuming the answer is yes, the tactical work here is...
@toddreifsteck WDYT, does that seem reasonable? |
performance entry buffer
interaction w/ existing buffersRelated discussions: - #81 (comment) - #87 (comment) - #77
I'm not certain if we should allow UA to clear buffer at a memory pressure. That would make the API a lot less reliable. |
@rniwa fair enough. Does the rest look reasonable to you? |
What's the rationale for each spec to define its own limit? Isn't it easier to have a global limit? |
@rniwa we've all implemented separate buffers for each type, and I think there is a good argument that different types of events (i.e. some specs) may need different limits. As a concrete example, our current limit for ResourceTiming is, arguably, too low: w3c/resource-timing#89. At the same time, I don't think it makes sense to raise the limit to a higher number for all event types.. WDYT? |
@igrigorik Here are my thoughts. Does this answer the questions in a way that helps close on the spec update you plan to make? I assert that the memory pressure needs to stay. UAs will clear the buffers regardless of what the specs say if they can avoid crashing and performance issues due to memory pressure so we should keep that text. It should be a corner case and will not impact the real world for 99.9% of usage. Upstream specs should define a min and max buffer size. In general, each spec needs to consider carefully what will occur when buffers are cleared and buffer management is recommended but the Performance Timeline should defer those decisions to each spec/buffer in my opinion. Should the global Performance Entry buffer we redefined as a merge of the various separate buffers? |
@toddreifsteck thanks, yes that sounds reasonable.
Effectively, that is how it is defined today. |
Going back to this and given the work done on w3c/resource-timing#163, I think it makes sense to move all the buffer processing to a central location. I also think we need to go beyond that and define the "buffer full" behavior and events in a generic way (e.g. In Chromium's implementation, there are a lot of parallels between Resource Timing and Event Timing on that front). I guess the main question is if we want this to be an L2 blocker, as it's a rather large refactoring. |
I don't think it needs to block L2. I think it makes more sense to do it in L3 when we define things in terms of fetch. |
Ditto, I don't think this is an L2 blocker. Also, in a world where PerfObserver is the new default, we may be able to soft deprecate the buffer bits.. |
Discussed at TPAC 2018:
|
Discussed this today with @yoavweiss and @tdresser. I'd like to work on this by doing the following:
Does this make sense to others? Ideally I'd work on this after we have (re)published Level 2 because all of these changes should be considered L3 as they are only relevant for the buffered flag. Is anyone working on the Level 2 work? I see that the buffered flag PR is quite old (b763e5c) so if we want to publish using earlier commits then we'd need to pin the commit and then manually revert anything related to the bufferd flag. |
The work here is done, yay. Closing |
We recently (see #76) added an optional flag to "queue an entry" that allows the caller to optionally append the entry to the performance entry buffer.. For example, Long Tasks or Server Timing can set this to
true
while before onload to allow developers to register and retrieve any LT/ST records captured between start of page load and max(time when they register observer, onloadend).A few interactions that we did not address:
performance entry buffer
?performance entry buffer
?Sidenote: moving forward we're not planning on adding more type-specific buffers.. Instead, we want to encourage use of PerfObserver. So, this is mostly an exercise in backwards compat and to make sure that we can pave a clean path for existing users of RT/NT/UT.
For (1), my hunch is "no", calls to clear type-specific buffers should not clear the performance entry buffer. This does mean that we might end up with some double book-keeping, but one of the motivating reasons for PerfObserver was to resolve the race conditions created by consumers clearing buffers from under each other. As such, I think I propose we treat them as separate entities: it should be possible to clear the RT buffer and still use PerfObserver with
buffered: true
to get all the entries queued before onload.For (2), my hunch is "yes", and we should probably recommend a minimum ~ user agent should allow a minimum of XXXX entries to be queued, and once full the items are silently discarded.
/cc @cvazac @nicjansma @toddreifsteck
The text was updated successfully, but these errors were encountered: