-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Investigate whether we can make vsync reliable in the presence of throttling #7589
Comments
Certainly possible. We clearly separate in vsync animation frames vs measure/mutate frames. The non-animation frames can be enforced to execute with the timeout. Unfortunately, that would take some performance hit to run the "just in case" timer. |
@cramforce I understand this causes problems if rAF is not reliable. But can you explain what's special about the inabox case? |
in-a-box iframes can and very likely will be throttled by browsers. Which mostly means that |
It can be throttled for a "good reason" or by a bug (at least weird behavior). I think we only worry about the bug cases, right? So we're worrying about that inabox is more likely to hit the bug (weird behavior)? |
It's not a bug - it's a browser feature. In-a-box is likely to hit it because it's likely to be out of viewport. |
I think the performance hit should be absolutely minimal |
Add a backup timer for non-animation vsync tasks. This ensures that non-animation tasks still eventually (timer at 2.5X normal rAF time) execute when we somehow failed to detect that we aren't visible. Fixes ampproject#7589
Add a backup timer for non-animation vsync tasks. This ensures that non-animation tasks still eventually (timer at 2.5X normal rAF time) execute when we somehow failed to detect that we aren't visible. Fixes #7589
…t#7639) Add a backup timer for non-animation vsync tasks. This ensures that non-animation tasks still eventually (timer at 2.5X normal rAF time) execute when we somehow failed to detect that we aren't visible. Fixes ampproject#7589
E.g. we can see to always set a timeout for like 32ms and debounce that while rAFs fire.
This may be crucial for AMP in a box. CC @lannka, @dvoytenko
#7482 is an example of how this can go wrong.
The text was updated successfully, but these errors were encountered: