Skip to content
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

Reporting work outside of event loop can cause leaks #77

Closed
annevk opened this issue Nov 22, 2019 · 9 comments · Fixed by whatwg/html#5123
Closed

Reporting work outside of event loop can cause leaks #77

annevk opened this issue Nov 22, 2019 · 9 comments · Fixed by whatwg/html#5123

Comments

@annevk
Copy link
Member

annevk commented Nov 22, 2019

It seems there could be plenty of execution, but because they're not tasks it's counted as idle time?

@npm1
Copy link
Contributor

npm1 commented Nov 22, 2019

This is meant to capture work that occurs in the process which does not correspond to event loop tasks or update the rendering. Can you clarify how the processing model does not account for update the rendering? I think the problem you're referring to is that event loop begin is set too late, in step 3 which would be skipped if there are not tasks. So we can move the step "Report the duration of time during which the user agent does not execute this loop" to the very beginning, to avoid this step being skipped. Does that make sense?

@annevk
Copy link
Member Author

annevk commented Nov 24, 2019

Event loop begin not always being updated seems like a problem as well, yes.

I don't see how moving this to the beginning of the loop helps with capturing that nothing happened during the loop.

@npm1
Copy link
Contributor

npm1 commented Nov 27, 2019

I'm confused about the problem you see then. There already is "Report the duration of the update the rendering step" which accounts for update the rendering.

@annevk
Copy link
Member Author

annevk commented Dec 3, 2019

I don't see how this is measuring idle time. How do you get through an entire loop without running any script, and then end up here again knowing that nothing executed during the loop?

@npm1
Copy link
Contributor

npm1 commented Dec 3, 2019

That's just idle time because we're checking whether there are tasks and there's none. No longtasks are expected when the browser is idle? What we're interested in is 'time during which the user agent does not execute this loop'. When performing a task outside of the event loop, you're not doing an event loop run. The duration of this task is estimated using the delta between when the previous event loop run ended and when the current event loop run began.

@annevk
Copy link
Member Author

annevk commented Dec 4, 2019

What kind of task would be performed outside the event loop? Also, how is that not a cross-process information leak?

@npm1
Copy link
Contributor

npm1 commented Dec 4, 2019

Garbage collection and in general any tasks which a browser generally does but are not spec'd because they are implementation details. Although I'm not actually sure if there are tasks which can be 'attributed' to a frame but run outside of the event loop. @domenic do you know of any example? Otherwise I think it should be fine to remove this one and assume every long task comes from an event loop task + microtasks or from update the rendering.

@domenic
Copy link
Contributor

domenic commented Dec 4, 2019

I'm not sure myself. @dtapuska did a survey of all of the task types at one point and might know better...

@annevk
Copy link
Member Author

annevk commented Dec 4, 2019

@npm1 npm1 changed the title "Not execute this loop" does not account for update the rendering Reporting work outside of event loop can cause leaks Dec 4, 2019
domenic pushed a commit to whatwg/html that referenced this issue Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants