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

[scheduler] Yield many times per frame, no rAF #16214

Merged
merged 1 commit into from
Jul 26, 2019

Commits on Jul 25, 2019

  1. [scheduler] Yield many times per frame, no rAF

    Adds experimental flag to yield many times per frame using a message
    event loop, instead of the current approach of guessing the next vsync
    and yielding at the end of the frame.
    
    This new approach forgoes a `requestAnimationFrame` entirely. It posts a
    message event and performs a small amount of work (5ms) before yielding
    to the browser, regardless of where it might be in the vsync cycle. At
    the end of the event, if there's work left over, it posts another
    message event.
    
    This should keep the main thread responsive even for really high frame
    rates. It also shouldn't matter if the hardware frame rate changes after
    page load (our current heuristic only detects if the frame rate
    increases, not decreases).
    
    The main risk is that yielding more often will exacerbate main thread
    contention with other browser tasks.
    
    Let's try it and see.
    acdlite committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    5b706be View commit details
    Browse the repository at this point in the history