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

Memoize promise listeners to prevent exponential growth #14429

Merged
merged 3 commits into from
Dec 14, 2018

Commits on Dec 14, 2018

  1. Memoize promise listeners to prevent exponential growth

    Previously, React would attach a new listener every time a promise is
    thrown, regardless of whether the same listener was already attached
    during a previous render. Because React attempts to render every time
    a promise resolves, the number of listeners grows quickly.
    
    This was especially bad in synchronous mode because the renders that
    happen when the promise pings are not batched together. So if a single
    promise has multiple listeners for the same root, there will be multiple
    renders, which in turn results in more listeners being added to the
    remaining unresolved promises. This results in exponential growth in
    the number of listeners with respect to the number of IO-bound
    components in a single render.
    
    Fixes facebook#14220
    acdlite committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    53e8639 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4c1bedc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3b60eef View commit details
    Browse the repository at this point in the history