-
Notifications
You must be signed in to change notification settings - Fork 36
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
Clarify when entry is added to performance entry buffer #82
Comments
Has there been any update on this? All of the current web-platform-tests seem to require the PerformanceEntry be added before the Resource's load event. However, I'm guessing they existed before PerformanceObserver; which seems to be the major reason to push for allowing entries to be added post-onload. I was also unable to find a list of interop issues. #55 (comment) pointed to a test file that no longer exists. |
@igrigorik I wrote a script to test when an entry is made available in resource timing buffer. I tested it on Chrome and Firefox Nightly using PerformanceObserver. I can also help in writing interop tests for this |
We may change that soon in Chrome. Or, at least, there are discussions for pushing delivery of entries towards idle time, which may change what you're seeing.. and such change is compliant to what we specced for PO. /cc @tdresser @spanicker
Some tests for what the implementations do today, specifically with respect to when entries become available in perf timeline (independent of PO) is the right place to start, I think.. @skjindal93 if you're willing to wire up WPT tests for that, that would be super helpful. If we find that all implementations deliver before onload, we might as well lock that in. |
I don't think that PerformanceObserver means we should stop adding entries before load. The only significant work from the PerformanceObserver is the callback, and when queueing an entry we only queue a task for that callback, not just run it immediately. What's important is that there is no guarantee that the task will be run before onload, since it is a low priority task. |
@npm - so if I understand you correctly, we could have a guaranty that entries are added to the buffer before onload, but not a guaranty that PO will fire before it. Is that correct? @igrigorik & @toddreifsteck - Assuming that the above is correct, would you be OK with modifying the spec to say that entries MUST be added to the queue before the onload event, but PO tasks may actually fire afterwards? |
If I understand the comment in [1] correctly, WebKit decided to change their behavior to add entries to the performance buffer asynchronously. [1] #141 (comment) |
@npm1 - yeah, your resources_added_by_onload test no longer seem to pass there (but with a couple of timeouts, so it doesn't seem like onload is losing the race every single time). In any case, I think we need to separate three cases:
|
I was looking at the spec for #163 and I'm failing to find:
Seems like we need some Fetch integration for the former, which will also define when the entry is added. Then we need "add a PRT entry" to call into PO in a way that bypasses the normal queueing (as RT has its own special buffering logic) |
Within ResourceTiming, they seem to be called at the end of the processing model. What I understand out of it is that we should call those once we've fetched the resource and it's not a redirect. We could probably put it at the end of the fetch algorithm. I think the main fetch is supposed to return something but its last step doesn't return anything? It's probably missing a step like this:
|
TPAC F2F consensus: We're going to defer this issue until the fetch integration is done. Defining when a resource load finishes is problematic because, for example, a given resource may have trailers which may delay the completion of the total resource load time but not the completion time of the resource body. |
Fetch integration is now prepared for handling this. In essence, every initiator should decide when it reports to resource timing and when it sends to load event, but we should probably have a policy so that resources do this in a consistent fashion, and perhaps have a reusable algorithm in the HTML spec for resources that behave similarly. |
As a general rule in whatwg/html#6542, the entry is added on This clarifies that the entry should be added before the load/error event. The tests in resource-timing WPT rely on that. |
Sounds great! Can we close this then? |
I believe so. |
Discussion: https://www.w3.org/2016/11/30-webperf-minutes.html
Background: #55. In #79 we added a note to flag the implementation differences across browsers. Ideally, we should aim to converge on a consistent implementation:
The text was updated successfully, but these errors were encountered: