GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use Global Render Timeout for CPU Suspense by sebmarkbage · Pull Request #19643 · react/react

Conversation

@sebmarkbage

@sebmarkbage sebmarkbage commented Aug 19, 2020

Copy link
Copy Markdown
Contributor

We have a heuristic in SuspenseList for "CPU Suspense" when a render takes too long. The start time that is used for this calculation isn't very good because it's based on when the list started rendering but really it should be when the whole render started.

We've talked about using the event time as the start time for this heuristic. However, it doesn't really make sense for a transition that has waited a long time on I/O already to immediately trigger CPU suspense. JND might be more applicable. The event time is a fairly complicated calculation. I don't think we'll use it for anything else now that we're removing the timeouts from transitions.

Therefore I use a much simpler start time that just counts when we started rendering. For concurrent renders that means the time at which we switched roots or interrupted.

For synchronous renders, the start time should be the start of the whole sequence or when the concurrent render started which then ended up with an additional synchronous pass. Since we haven't yielded for paint yet it doesn't make sense to reset the clock.

Additionally, I changed it so that the lane that schedules the continuation of CPU bound work to always be a Retry. Conceptually it's similar to an immediately pinging promise. We shouldn't continue rendering on the same "transition" once we've committed it. It's no longer part of the same transition. Notably we shouldn't continue rendering at sync priority if we the sync priority yielded due to CPU suspense since that wouldn't let us paint in between.

I also added a more aggressive yield. Previously we rendered at least one row. Now we don't even render one row if we've already "expired" by the time we get to the suspense list. I originally didn't do it that way because if something goes wrong (such as if it takes more than 500ms to reach the boundary), we won't make progress. This means that it's extra important to get this right since otherwise we won't ever render any content.

Taken together this fixes an issue where if you call setState in useLayoutEffect, then that used to force one sync row to be added, which then did the same thing and effectively synchronously blocked display.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

NE-SmallTown and okmttdhr reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@sebmarkbage
sebmarkbage requested review from acdlite, lunaruan and rickhanlonii August 19, 2020 02:44
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Aug 19, 2020
@codesandbox-ci

codesandbox-ci Bot commented Aug 19, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2b8b3fc:

Sandbox Source
React Configuration
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sizebot

sizebot commented Aug 19, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Details of bundled changes.

Comparing: 23595ff...2b8b3fc

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.2% +0.1% 913.69 KB 915.14 KB 207.51 KB 207.64 KB NODE_DEV
ReactDOMForked-prod.js 🔺+0.1% 🔺+0.1% 381.81 KB 382.35 KB 70.39 KB 70.45 KB FB_WWW_PROD
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 123.99 KB 124.07 KB 39.78 KB 39.82 KB NODE_PROD
ReactDOMForked-profiling.js +0.1% +0.1% 395.34 KB 395.88 KB 72.87 KB 72.93 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 144.75 KB 144.75 KB 36.78 KB 36.78 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 12.91 KB 12.91 KB 5.06 KB 5.06 KB UMD_PROD
ReactDOMTesting-dev.js +0.1% +0.1% 922.26 KB 923.6 KB 207.35 KB 207.48 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 60.92 KB 60.92 KB 17.66 KB 17.66 KB NODE_DEV
ReactDOMTesting-prod.js 🔺+0.1% 🔺+0.1% 380.28 KB 380.71 KB 71.45 KB 71.53 KB FB_WWW_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 5.52 KB 5.52 KB 1.84 KB 1.84 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 12.74 KB 12.74 KB 4.98 KB 4.98 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% -0.3% 1.17 KB 1.17 KB 668 B 666 B NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.22 KB 1.22 KB 713 B 712 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 4.78 KB 4.78 KB 1.68 KB 1.68 KB NODE_DEV
react-dom.development.js +0.2% +0.1% 959.88 KB 961.4 KB 210.08 KB 210.19 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.2% 1.01 KB 1.01 KB 617 B 616 B NODE_PROD
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 123.89 KB 123.96 KB 40.48 KB 40.52 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 129.14 KB 129.23 KB 42.1 KB 42.16 KB UMD_PROFILING
ReactDOMForked-dev.js +0.1% +0.1% 967.83 KB 969.06 KB 215.18 KB 215.38 KB FB_WWW_DEV
react-dom.profiling.min.js +0.1% +0.1% 129.43 KB 129.52 KB 41.38 KB 41.43 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.34 KB 20.34 KB 7.55 KB 7.54 KB UMD_PROD
ReactDOM-dev.js +0.2% +0.1% 960.86 KB 962.33 KB 214.4 KB 214.51 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% 🔺+0.1% 378.29 KB 378.83 KB 69.75 KB 69.82 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% -0.0% 137.32 KB 137.32 KB 36.35 KB 36.34 KB NODE_DEV
ReactDOM-profiling.js +0.1% +0.1% 391.38 KB 391.91 KB 72.15 KB 72.22 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.24 KB 20.24 KB 7.5 KB 7.5 KB NODE_PROD
ReactDOMServer-dev.js 0.0% -0.0% 142.98 KB 142.98 KB 36.33 KB 36.33 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 46.44 KB 46.44 KB 10.83 KB 10.83 KB FB_WWW_PROD
react-dom-test-utils.development.js 0.0% -0.0% 65.92 KB 65.92 KB 18.18 KB 18.18 KB UMD_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js 🔺+0.1% 🔺+0.1% 238.15 KB 238.48 KB 41.95 KB 41.99 KB FB_WWW_PROD
react-art.development.js +0.2% +0.1% 694.11 KB 695.46 KB 147.12 KB 147.23 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 112.8 KB 112.81 KB 34.96 KB 34.98 KB UMD_PROD
react-art.development.js +0.2% +0.1% 595.23 KB 596.53 KB 129.3 KB 129.39 KB NODE_DEV
react-art.production.min.js 0.0% 🔺+0.1% 77.68 KB 77.7 KB 24.04 KB 24.06 KB NODE_PROD
ReactART-dev.js +0.2% +0.1% 622.03 KB 623.31 KB 132.12 KB 132.24 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.2% +0.1% 653.62 KB 655.08 KB 139.56 KB 139.67 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.0% 16.62 KB 16.62 KB 4.96 KB 4.96 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.1% 🔺+0.1% 87.61 KB 87.69 KB 26.88 KB 26.91 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.81 KB 2.81 KB 1.16 KB 1.16 KB NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +0.2% +0.1% 605.47 KB 606.86 KB 127.38 KB 127.49 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 76.99 KB 77.01 KB 24.16 KB 24.17 KB UMD_PROD
react-test-renderer.development.js +0.2% +0.1% 576.9 KB 578.22 KB 125.94 KB 126.05 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 🔺+0.1% 76.77 KB 76.8 KB 23.8 KB 23.83 KB NODE_PROD
ReactTestRenderer-dev.js +0.2% +0.1% 592.37 KB 593.68 KB 127.15 KB 127.25 KB FB_WWW_DEV
ReactTestRenderer-dev.js +0.2% +0.1% 587 KB 588.31 KB 126.88 KB 126.99 KB RN_FB_DEV
ReactTestRenderer-prod.js 🔺+0.2% 🔺+0.1% 232.34 KB 232.73 KB 42.21 KB 42.24 KB RN_FB_PROD
ReactTestRenderer-profiling.js +0.1% +0.1% 243.74 KB 244.07 KB 44.36 KB 44.4 KB RN_FB_PROFILING

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.2% +0.1% 680.16 KB 681.47 KB 147.69 KB 147.82 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 273.14 KB 273.52 KB 48.57 KB 48.63 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 284.65 KB 284.98 KB 50.76 KB 50.82 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.2% +0.1% 660.76 KB 662.07 KB 143.05 KB 143.15 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.2% 266.81 KB 267.2 KB 47.26 KB 47.33 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% +0.1% 278.41 KB 278.74 KB 49.46 KB 49.53 KB RN_OSS_PROFILING

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against 2b8b3fc

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sizebot

sizebot commented Aug 19, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Details of bundled changes.

Comparing: 23595ff...2b8b3fc

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.2% +0.1% 877.93 KB 879.33 KB 200.98 KB 201.1 KB NODE_DEV
ReactDOMForked-prod.js 🔺+0.1% 🔺+0.1% 392.96 KB 393.52 KB 72.13 KB 72.2 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% -0.0% 137.08 KB 137.08 KB 36.38 KB 36.38 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 119.38 KB 119.45 KB 38.4 KB 38.43 KB NODE_PROD
ReactDOMForked-profiling.js +0.1% +0.1% 406.54 KB 407.1 KB 74.59 KB 74.68 KB FB_WWW_PROFILING
react-dom-server.node.production.min.js 0.0% -0.0% 20.2 KB 20.2 KB 7.58 KB 7.58 KB NODE_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 12.9 KB 12.9 KB 5.05 KB 5.05 KB UMD_PROD
ReactDOMTesting-dev.js +0.1% +0.1% 950.32 KB 951.68 KB 212.87 KB 212.98 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 60.91 KB 60.91 KB 17.65 KB 17.65 KB NODE_DEV
ReactDOMTesting-prod.js 🔺+0.1% 🔺+0.1% 392.91 KB 393.36 KB 73.53 KB 73.59 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 12.73 KB 12.73 KB 4.97 KB 4.97 KB NODE_PROD
react-dom.development.js +0.2% +0.1% 922.36 KB 923.83 KB 203.45 KB 203.55 KB UMD_DEV
react-dom.production.min.js 0.0% 🔺+0.1% 119.35 KB 119.41 KB 39.05 KB 39.09 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 123.25 KB 123.31 KB 40.29 KB 40.33 KB UMD_PROFILING
ReactDOMForked-dev.js +0.1% +0.1% 993.33 KB 994.58 KB 219.94 KB 220.17 KB FB_WWW_DEV
react-dom.profiling.min.js +0.1% +0.1% 123.45 KB 123.52 KB 39.66 KB 39.69 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 19.88 KB 19.88 KB 7.46 KB 7.46 KB UMD_PROD
ReactDOM-dev.js +0.2% +0.1% 986.35 KB 987.85 KB 219.07 KB 219.23 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% 🔺+0.1% 389.44 KB 390 KB 71.45 KB 71.52 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% -0.0% 135.81 KB 135.81 KB 36.13 KB 36.13 KB NODE_DEV
ReactDOM-profiling.js +0.1% +0.1% 402.57 KB 403.13 KB 73.86 KB 73.93 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 19.78 KB 19.78 KB 7.42 KB 7.42 KB NODE_PROD
ReactDOMServer-dev.js 0.0% -0.0% 147.01 KB 147.01 KB 37.33 KB 37.33 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 47.3 KB 47.3 KB 11.04 KB 11.04 KB FB_WWW_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js 🔺+0.1% 🔺+0.1% 245.29 KB 245.63 KB 43.21 KB 43.26 KB FB_WWW_PROD
react-art.development.js +0.2% +0.1% 667 KB 668.35 KB 142.11 KB 142.21 KB UMD_DEV
react-art.production.min.js 0.0% 🔺+0.1% 109.82 KB 109.84 KB 34.06 KB 34.09 KB UMD_PROD
react-art.development.js +0.2% +0.1% 569.39 KB 570.69 KB 124.38 KB 124.48 KB NODE_DEV
react-art.production.min.js 0.0% 🔺+0.1% 74.77 KB 74.78 KB 23.18 KB 23.2 KB NODE_PROD
ReactART-dev.js +0.2% +0.1% 632.04 KB 633.33 KB 134.15 KB 134.27 KB FB_WWW_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.2% +0.1% 685.54 KB 686.85 KB 148.53 KB 148.66 KB RN_FB_DEV
ReactFabric-dev.js +0.2% +0.1% 666.15 KB 667.46 KB 143.9 KB 144 KB RN_FB_DEV
ReactNativeRenderer-dev.js +0.2% +0.1% 680.14 KB 681.46 KB 147.68 KB 147.81 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.2% 266.76 KB 267.15 KB 47.23 KB 47.3 KB RN_FB_PROD
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 273.13 KB 273.51 KB 48.56 KB 48.62 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% +0.1% 278.36 KB 278.69 KB 49.43 KB 49.5 KB RN_FB_PROFILING
ReactNativeRenderer-profiling.js +0.1% +0.1% 284.63 KB 284.97 KB 50.75 KB 50.82 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 273.08 KB 273.47 KB 48.55 KB 48.61 KB RN_FB_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 284.59 KB 284.92 KB 50.73 KB 50.79 KB RN_FB_PROFILING
ReactFabric-dev.js +0.2% +0.1% 660.74 KB 662.05 KB 143.04 KB 143.14 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.2% 266.8 KB 267.19 KB 47.25 KB 47.32 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% +0.1% 278.4 KB 278.73 KB 49.45 KB 49.52 KB RN_OSS_PROFILING

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.2% +0.1% 625.3 KB 626.76 KB 134.06 KB 134.18 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.0% 16.61 KB 16.61 KB 4.96 KB 4.95 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.1% 🔺+0.1% 84.26 KB 84.33 KB 25.94 KB 25.97 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.8 KB 2.8 KB 1.15 KB 1.15 KB NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +0.2% +0.1% 605.45 KB 606.83 KB 127.36 KB 127.47 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 76.96 KB 76.99 KB 24.14 KB 24.15 KB UMD_PROD
react-test-renderer.development.js +0.2% +0.1% 576.87 KB 578.2 KB 125.93 KB 126.03 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 🔺+0.1% 76.75 KB 76.77 KB 23.79 KB 23.81 KB NODE_PROD
ReactTestRenderer-dev.js +0.2% +0.1% 592.36 KB 593.67 KB 127.14 KB 127.25 KB FB_WWW_DEV
ReactTestRenderer-dev.js +0.2% +0.1% 586.99 KB 588.3 KB 126.87 KB 126.97 KB RN_FB_DEV
ReactTestRenderer-prod.js 🔺+0.2% 🔺+0.1% 232.33 KB 232.71 KB 42.2 KB 42.24 KB RN_FB_PROD
ReactTestRenderer-profiling.js +0.1% +0.1% 243.72 KB 244.06 KB 44.35 KB 44.39 KB RN_FB_PROFILING

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (stable)

Generated by 🚫 dangerJS against 2b8b3fc

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sebmarkbage added 2 commits August 18, 2020 23:03
@sebmarkbage
Use Retry lane for resuming CPU suspended work
2abbea2
@sebmarkbage
Use a global render timeout for CPU suspense heuristics
80de8e3
@sebmarkbage
sebmarkbage force-pushed the suspenselistfix branch from b94b99b to 86bf60e Compare August 19, 2020 03:03
sebmarkbage added 3 commits August 18, 2020 23:09
@sebmarkbage
Fix profiler test since we're now reading time more often
c39f837
@sebmarkbage
Sync to new reconciler
1593a1f
@sebmarkbage
Test synchronously rerendering should not render more rows
2b8b3fc
@sebmarkbage
sebmarkbage force-pushed the suspenselistfix branch from 86bf60e to 2b8b3fc Compare August 19, 2020 03:09
acdlite
acdlite approved these changes Aug 20, 2020
View reviewed changes

@acdlite acdlite left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

Should we also account for multiple roots that have synchronous work? I think the clock should be reset when the root switches. Would need to refactor this check a bit:

https://github.com/facebook/react/blob/2b8b3fc72fd936c8b4faaabd6cda904872b7a566/packages/react-reconciler/src/ReactFiberWorkLoop.new.js#L1055

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/react-reconciler/src/ReactFiberWorkLoop.new.js
markRootExpired(root, lanes);
ensureRootIsScheduled(root, now());
if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
resetRenderTimer();

@acdlite acdlite Aug 20, 2020

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could put this call inside flushSyncCallbackQueue? Since that's the entry point for synchronous work.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sebmarkbage sebmarkbage Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all of them check for NoContext, so I was hesitant to do that without digging into why that is first.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sebmarkbage

sebmarkbage commented Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

Should we also account for multiple roots that have synchronous work? I think the clock should be reset when the root switches

I think the clock shouldn't actually reset because the time is the time until we've been able to show something. Not the time it took to render a particular piece of work. So the mechanism is about forcing things to yield to paint as soon as possible, even if it's synchronous work. Ideally this would work across renderers too with something on scheduler indicating how long we've gone before previous paint.

acdlite reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sebmarkbage
sebmarkbage merged commit d6e4338 into react:master Aug 20, 2020
@sebmarkbage

sebmarkbage commented Aug 21, 2020

Copy link
Copy Markdown
Contributor Author

This was a bad idea. I think we end up calling reset too much because we reset it even if nothing is in the sync queue. It might also be too easy to create interruptions now. Maybe it needs to be a start time per lane after all. We'll need to be more clever about when we reset this timer.

NE-SmallTown reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gaearon added a commit that referenced this pull request Aug 31, 2020
@gaearon
Revert "Use Global Render Timeout for CPU Suspense (#19643)"
979b115
This reverts commit d6e4338.
@gaearon gaearon mentioned this pull request Sep 1, 2020
Revert "Use Global Render Timeout for CPU Suspense" #19740
Closed
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Oct 27, 2020
@rickhanlonii @facebook-github-bot
Update React Native to React 17.0.0
24bca49
Summary:
This sync includes the following changes:
- **[eaaf4cb](react/react@eaaf4cbce )**: 17.0.1 //<Dan Abramov>//
- **[6f62abb](react/react@6f62abb58 )**: Remove usage of Array#fill ([#20071](react/react#20071)) //<Dan Abramov>//
- **[40cfe1f](react/react@40cfe1f48 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[f021a98](react/react@f021a983a )**: Bump versions for 17 ([#20062](react/react#20062)) //<Dan Abramov>//
- **[d1bb4d8](react/react@d1bb4d851 )**: Profiler: Include ref callbacks in onCommit duration ([#20060](react/react#20060)) //<Brian Vaughn>//
- **[c59c3df](react/react@c59c3dfe5 )**: useRef: Warn about reading or writing mutable values during render ([#18545](react/react#18545)) //<Brian Vaughn>//
- **[7b6cac9](react/react@7b6cac952 )**: Improved Profiler commit hooks test ([#20053](react/react#20053)) //<Brian Vaughn>//
- **[dfb6a40](react/react@dfb6a4033 )**: [Fast Refresh] Fix crashes caused by rogue Proxies ([#20030](react/react#20030)) ([#20039](react/react#20039)) //<Kai Riemann>//
- **[37cb732](react/react@37cb732c5 )**: Use bitwise OR to define flag masks ([#20044](react/react#20044)) //<Andrew Clark>//
- **[eb3181e](react/react@eb3181e77 )**: Add Visibility flag for hiding/unhiding trees ([#20043](react/react#20043)) //<Andrew Clark>//
- **[0dd809b](react/react@0dd809bdf )**: Remove last schedulePassiveEffectCallback call ([#20042](react/react#20042)) //<Andrew Clark>//
- **[8df7b79](react/react@8df7b7911 )**: Remove Passive flag from "before mutation" phase ([#20038](react/react#20038)) //<Andrew Clark>//
- **[c57fe4a](react/react@c57fe4a2c )**: ReactIs.isValidElementType Unit Test extended with PureComponent case ([#20033](react/react#20033)) //<adasq>//
- **[02da938](react/react@02da938fd )**: Don't double-invoke effects in legacy roots ([#20028](react/react#20028)) //<Brian Vaughn>//
- **[d95c493](react/react@d95c4938d )**: [EventSystem] Revise onBeforeBlur propagation mechanics ([#20020](react/react#20020)) //<Dominic Gannaway>//
- **[f46a80a](react/react@f46a80ae1 )**: Update outdated links and fix two broken links  ([#19985](react/react#19985)) //<Saikat Guha>//
- **[0a4c7c5](react/react@0a4c7c565 )**: [Flight] Don't warn for key, but error for ref ([#19986](react/react#19986)) //<Sebastian Markbåge>//
- **[993ca53](react/react@993ca533b )**: Enable eager listeners statically ([#19983](react/react#19983)) //<Dan Abramov>//
- **[40c52de](react/react@40c52de96 )**: [Flight] Add Runtime Errors for Non-serializable Values ([#19980](react/react#19980)) //<Sebastian Markbåge>//
- **[1992d97](react/react@1992d9730 )**: Revert "Temporarily disable Profiler commit hooks flag ([#19900](react/react#19900))" ([#19960](react/react#19960)) //<Brian Vaughn>//
- **[44d39c4](react/react@44d39c4d7 )**: Removed skip-error-boundaries modifications from old fork ([#19961](react/react#19961)) //<Brian Vaughn>//
- **[cc77be9](react/react@cc77be957 )**: Remove unnecessary error overriding in ([#19949](react/react#19949)) //<Paul Doyle>//
- **[9762527](react/react@97625272a )**: Debug tracing tests for CPU bound suspense ([#19943](react/react#19943)) //<Brian Vaughn>//
- **[43363e2](react/react@43363e279 )**: Fix codestyle for typeof comparison ([#19928](react/react#19928)) //<Eugene Maslovich>//
- **[5427b46](react/react@5427b4657 )**: Temporarily disable Profiler commit hooks flag ([#19900](react/react#19900)) //<Brian Vaughn>//
- **[1faf9e3](react/react@1faf9e3dd )**: Suspense for CPU-bound trees ([#19936](react/react#19936)) //<Andrew Clark>//
- **[7f08e90](react/react@7f08e908b )**: Fix missing context to componentDidMount() when double-invoking lifecycles ([#19935](react/react#19935)) //<Brian Vaughn>//
- **[9198a5c](react/react@9198a5cec )**: Refactor layout effect methods ([#19895](react/react#19895)) //<Brian Vaughn>//
- **[ba82eea](react/react@ba82eea38 )**: Remove disableSchedulerTimeoutInWorkLoop flag ([#19902](react/react#19902)) //<Andrew Clark>//
- **[c63741f](react/react@c63741fb3 )**: offscreen double invoke effects ([#19523](react/react#19523)) //<Luna Ruan>//
- **[c691734](react/react@c6917346f )**: Fixed broken Profiler test ([#19894](react/react#19894)) //<Brian Vaughn>//
- **[87c023b](react/react@87c023b1c )**: Profiler onRender only called when we do work ([#19885](react/react#19885)) //<Brian Vaughn>//
- **[81aaee5](react/react@81aaee56a )**: Don't call onCommit et al if there are no effects ([#19863](react/react#19863)) //<Andrew Clark>//
- **[7355bf5](react/react@7355bf575 )**: Consolidate commit phase hook functions ([#19864](react/react#19864)) //<Andrew Clark>//
- **[bc6b7b6](react/react@bc6b7b6b1 )**: Don't trigger lazy in DEV during element creation ([#19871](react/react#19871)) //<Dan Abramov>//
- **[a774502](react/react@a774502e0 )**: Use single quotes in getComponentName return ([#19873](react/react#19873)) //<Gustavo Saiani>//
- **[8b2d378](react/react@8b2d3783e )**: Use Passive flag to schedule onPostCommit ([#19862](react/react#19862)) //<Andrew Clark>//
- **[50d9451](react/react@50d9451f3 )**: Improve DevTools editing interface ([#19774](react/react#19774)) //<Brian Vaughn>//
- **[6fddca2](react/react@6fddca27e )**: Remove passive intervention flag ([#19849](react/react#19849)) //<Dan Abramov>//
- **[36df918](react/react@36df9185c )**: chore(docs): Removed outdated comment about fb.me link  ([#19830](react/react#19830)) //<Adnaan Bheda>//
- **[16fb2b6](react/react@16fb2b6f9 )**: Moved resetChildLanes into complete work ([#19836](react/react#19836)) //<Brian Vaughn>//
- **[cc58106](react/react@cc581065d )**: [email protected] //<Dan Abramov>//
- **[0044805](react/react@0044805c8 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[0f70d4d](react/react@0f70d4dd6 )**: Consider components in jsx as missing dependencies in typescript-eslint/[email protected] ([#19815](react/react#19815)) //<Sebastian Silbermann>//
- **[84558c6](react/react@84558c61b )**: Don't visit passive effects during layout phase ([#19809](react/react#19809)) //<Andrew Clark>//
- **[ad8a0a8](react/react@ad8a0a8cd )**: [email protected] //<Dan Abramov>//
- **[77544a0](react/react@77544a0d6 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[ed4fdfc](react/react@ed4fdfc73 )**: test(eslint-plugin-react-hooks): Run with TS parsers >= 2.x ([#19792](react/react#19792)) //<Sebastian Silbermann>//
- **[cd75f93](react/react@cd75f93c0 )**: eslint-plugin-react-hooks: fix compatibility with typescript-eslint/[email protected]+ ([#19751](react/react#19751)) //<Matthias Schiffer>//
- **[781212a](react/react@781212aab )**: Remove double space in test name ([#19762](react/react#19762)) //<Gustavo Saiani>//
- **[e7b2553](react/react@e7b255341 )**: Internal `act`: Flush timers at end of scope ([#19788](react/react#19788)) //<Andrew Clark>//
- **[d17086c](react/react@d17086c7c )**: Decouple public, internal act implementation ([#19745](react/react#19745)) //<Andrew Clark>//
- **[d38ec17](react/react@d38ec17b1 )**: [Flight] Set dispatcher for duration of performWork() ([#19776](react/react#19776)) //<Joseph Savona>//
- **[4f3f7ee](react/react@4f3f7eeb7 )**: Bugfix: Effect clean up when deleting suspended tree ([#19752](react/react#19752)) //<Andrew Clark>//
- **[7baf9d4](react/react@7baf9d412 )**: Combine Flags and SubtreeFlags types ([#19775](react/react#19775)) //<Andrew Clark>//
- **[1665443](react/react@166544360 )**: Rename effect fields ([#19755](react/react#19755)) //<Andrew Clark>//
- **[708fa77](react/react@708fa77a7 )**: Decrease expiration time of input updates ([#19772](react/react#19772)) //<Andrew Clark>//
- **[36df483](react/react@36df483af )**: Add feature flag to disable scheduler timeout in work loop ([#19771](react/react#19771)) //<Ricky>//
- **[bcc0aa4](react/react@bcc0aa463 )**: Revert "Revert "Remove onScroll bubbling flag ([#19535](react/react#19535))" ([#19655](react/react#19655))" ([#19761](react/react#19761)) //<Dan Abramov>//
- **[99cae88](react/react@99cae887f )**: Add failing test for passive effect cleanup functions and memoized components ([#19750](react/react#19750)) //<Brian Vaughn>//
- **[2cfd73c](react/react@2cfd73c4d )**: Fix typo in comment (Noticable→Noticeable) ([#19737](react/react#19737)) //<Ikko Ashimine>//
- **[53e622c](react/react@53e622ca7 )**: Fix instances of function declaration after return ([#19733](react/react#19733)) //<Bhumij Gupta>//
- **[b7d18c4](react/react@b7d18c4da )**: Support Babel's envName option in React Refresh plugin ([#19009](react/react#19009)) //<Kevin Weber>//
- **[1f38dcf](react/react@1f38dcff6 )**: Remove withSuspenseConfig ([#19724](react/react#19724)) //<Andrew Clark>//
- **[1396e4a](react/react@1396e4a8f )**: Fixes eslint warning when node type is ChainExpression ([#19680](react/react#19680)) //<Pascal Fong Kye>//
- **[a8500be](react/react@a8500be89 )**: Add `startTransition` as a known stable method ([#19720](react/react#19720)) //<Andrew Clark>//
- **[380dc95](react/react@380dc95de )**: Revert "Append text string to <Text> error message ([#19581](react/react#19581))" ([#19723](react/react#19723)) //<Timothy Yung>//
- **[ddd1faa](react/react@ddd1faa19 )**: Remove config argument from useTransition ([#19719](react/react#19719)) //<Andrew Clark>//
- **[92fcd46](react/react@92fcd46cc )**: Replace SuspenseConfig object with an integer ([#19706](react/react#19706)) //<Andrew Clark>//
- **[b754caa](react/react@b754caaaf )**: Enable eager listeners in open source ([#19716](react/react#19716)) //<Dan Abramov>//
- **[c1ac052](react/react@c1ac05215 )**: [Flight] Support more element types and Hooks for Server and Hybrid Components ([#19711](react/react#19711)) //<Dan Abramov>//
- **[1eaafc9](react/react@1eaafc9ad )**: Clean up timeoutMs-related implementation details ([#19704](react/react#19704)) //<Andrew Clark>//
- **[8da0da0](react/react@8da0da093 )**: Disable timeoutMs argument ([#19703](react/react#19703)) //<Andrew Clark>//
- **[60ba723](react/react@60ba723bf )**: Add SuspenseList to devTools ([#19684](react/react#19684)) //<Ben Pernick>//
- **[5564f2c](react/react@5564f2c95 )**: Add React.startTransition ([#19696](react/react#19696)) //<Ricky>//
- **[c4e0768](react/react@c4e0768d7 )**: Remove unused argument from `finishConcurrentRender` ([#19689](react/react#19689)) //<inottn>//
- **[848bb24](react/react@848bb2426 )**: Attach Listeners Eagerly to Roots and Portal Containers ([#19659](react/react#19659)) //<Dan Abramov>//
- **[d2e914a](react/react@d2e914ab4 )**: Remove remaining references to effect list ([#19673](react/react#19673)) //<Andrew Clark>//
- **[d6e4338](react/react@d6e433899 )**: Use Global Render Timeout for CPU Suspense ([#19643](react/react#19643)) //<Sebastian Markbåge>//
- **[64ddef4](react/react@64ddef44c )**: Revert "Remove onScroll bubbling flag ([#19535](react/react#19535))" ([#19655](react/react#19655)) //<Dan Abramov>//
- **[dd651df](react/react@dd651df05 )**: Keep onTouchStart, onTouchMove, and onWheel passive ([#19654](react/react#19654)) //<Dan Abramov>//
- **[b8fa09e](react/react@b8fa09e9e )**: provide profiling bundle for react-reconciler ([#19559](react/react#19559)) //<Julien Gilli>//
- **[23595ff](react/react@23595ff59 )**: Add missing param to safelyCallDestroy() ([#19638](react/react#19638)) //<Brian Vaughn>//
- **[ee409ea](react/react@ee409ea3b )**: change destroy to safelyCallDestroy ([#19605](react/react#19605)) //<Luna Ruan>//
- **[bcca5a6](react/react@bcca5a6ca )**: Always skip unmounted/unmounting error boundaries ([#19627](react/react#19627)) //<Brian Vaughn>//
- **[1a41a19](react/react@1a41a196b )**: Append text string to <Text> error message ([#19581](react/react#19581)) //<Timothy Yung>//
- **[e4afb2f](react/react@e4afb2fdd )**: [email protected] //<Dan Abramov>//
- **[ced05c4](react/react@ced05c46c )**: Update CHANGELOG.md //<Dan Abramov>//
- **[702fad4](react/react@702fad4b1 )**: refactor fb.me redirect link to reactjs.org/link ([#19598](react/react#19598)) //<CY Lim>//
- **[49cd77d](react/react@49cd77d24 )**: fix: leak strict mode with UMD builds ([#19614](react/react#19614)) //<Toru Kobayashi>//
- **[ffb749c](react/react@ffb749c95 )**: Improve error boundary handling for unmounted subtrees ([#19542](react/react#19542)) //<Brian Vaughn>//
- **[9b35dd2](react/react@9b35dd2fc )**: Permanently removed component stacks from scheduling profiler data ([#19615](react/react#19615)) //<Brian Vaughn>//
- **[3f8115c](react/react@3f8115cdd )**: Remove `didTimeout` check from work loop //<Andrew Clark>//
- **[9abc278](react/react@9abc2785c )**: Remove wasteful checks from `shouldYield` //<Andrew Clark>//
- **[1d5e10f](react/react@1d5e10f70 )**: [eslint-plugin-react-hooks] Report constant constructions ([#19590](react/react#19590)) //<Jordan Eldredge>//
- **[dab0854](react/react@dab0854c5 )**: Move commit passive unmount/mount to CommitWork ([#19599](react/react#19599)) //<Sebastian Markbåge>//
- **[ccb6c39](react/react@ccb6c3945 )**: Remove unused argument ([#19600](react/react#19600)) //<inottn>//
- **[6291255](react/react@629125555 )**: [Scheduler] Re-throw unhandled errors ([#19595](react/react#19595)) //<Andrew Clark>//
- **[b8ed6a1](react/react@b8ed6a1aa )**: [Scheduler] Call postTask directly ([#19551](react/react#19551)) //<Andrew Clark>//
- **[ce37bfa](react/react@ce37bfad5 )**: Remove resolutions from test renderer package.json ([#19577](react/react#19577)) //<Dan Abramov>//
- **[2704bb5](react/react@2704bb537 )**: Add ReactVersion to SchedulingProfiler render scheduled marks ([#19553](react/react#19553)) //<Kartik Choudhary>//
- **[0c52e24](react/react@0c52e24cb )**: Support inner component _debugOwner in memo ([#19556](react/react#19556)) //<Brian Vaughn>//
- **[0cd9a6d](react/react@0cd9a6de5 )**: Parallelize Jest in CI ([#19552](react/react#19552)) //<Andrew Clark>//
- **[a63893f](react/react@a63893ff3 )**: Warn about undefined return value for memo and forwardRef ([#19550](react/react#19550)) //<Brian Vaughn>//
- **[32ff428](react/react@32ff42868 )**: Add feature flag for setting update lane priority ([#19401](react/react#19401)) //<Ricky>//
- **[5bdd4c8](react/react@5bdd4c8c6 )**: Remove unused argument from call to jest method ([#19546](react/react#19546)) //<Gustavo Saiani>//
- **[a5fed98](react/react@a5fed98a9 )**: Register more node types that are used later as JSXIdentifiers ([#19514](react/react#19514)) //<Mateusz Burzyński>//
- **[f77c7b9](react/react@f77c7b9d7 )**: Re-add discrete flushing timeStamp heuristic (behind flag) ([#19540](react/react#19540)) //<Dominic Gannaway>//

Changelog: [general] [feature] Upgrade to React 17

Reviewed By: cpojer

Differential Revision: D24491201

fbshipit-source-id: c947da9dcccbd614e9dc58f3339b63e24829aca7
koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
@sebmarkbage @koto
Use Global Render Timeout for CPU Suspense (react#19643)
a73867b
* Use Retry lane for resuming CPU suspended work

* Use a global render timeout for CPU suspense heuristics

* Fix profiler test since we're now reading time more often

* Sync to new reconciler

* Test synchronously rerendering should not render more rows
This was referenced Sep 8, 2024
[Snyk] Upgrade: , react, react-dom, , , , formik, next, use-remote-data alvinrumbaoa/photography#128
Open
[Snyk] Upgrade: , react, react-dom, , , , formik, next, use-remote-data alvinrumbaoa/photography#131
Open
This was referenced Sep 20, 2024
[Snyk] Upgrade: , react, react-dom, , , , formik, next, use-remote-data alvinrumbaoa/photography#132
Open
[Snyk] Upgrade: , react, react-dom, , , , formik, next, use-remote-data alvinrumbaoa/photography#133
Open
This was referenced Oct 1, 2024
[Snyk] Upgrade react from 17.0.0 to 17.0.2 harrisonho99/IOS_Calculator#18
Closed
[Snyk] Upgrade react-dom from 17.0.0 to 17.0.2 harrisonho99/IOS_Calculator#19
Open
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
@sebmarkbage
Use Global Render Timeout for CPU Suspense (react#19643)
a2b0e22
* Use Retry lane for resuming CPU suspended work

* Use a global render timeout for CPU suspense heuristics

* Fix profiler test since we're now reading time more often

* Sync to new reconciler

* Test synchronously rerendering should not render more rows
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@sebmarkbage
Use Global Render Timeout for CPU Suspense (react#19643)
f16bee0
* Use Retry lane for resuming CPU suspended work

* Use a global render timeout for CPU suspense heuristics

* Fix profiler test since we're now reading time more often

* Sync to new reconciler

* Test synchronously rerendering should not render more rows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@acdlite acdlite acdlite approved these changes
@rickhanlonii rickhanlonii Awaiting requested review from rickhanlonii
@lunaruan lunaruan Awaiting requested review from lunaruan

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@sebmarkbage @sizebot @acdlite @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.