-
Notifications
You must be signed in to change notification settings - Fork 46.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
Don't group Idle/Offscreen work with other work #17456
Conversation
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 b1645e0:
|
Details of bundled changes.Comparing: f523b2e...b1645e0 react-native-renderer
react-test-renderer
react-art
react-dom
react-reconciler
ReactDOM: size: 0.0%, gzip: 0.0% Size changes (experimental) |
Details of bundled changes.Comparing: f523b2e...b1645e0 react-art
react-native-renderer
react-test-renderer
Size changes (stable) |
I think we’ll also have to do something about |
b70609d
to
e576ea1
Compare
nextLevel <= Idle && | ||
firstPendingTime !== nextLevel | ||
) { | ||
// Don't work on Idle/Never priority unless everything else is committed. |
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.
I'm a bit uneasy about this since if something goes wrong, it's not possible to unblock by pinging these levels. However, I don't think it ever happens now because these levels wouldn't ever be suspended if something else rendered at higher pri because that makes them unsuspended. I couldn't make a test that fails.
e576ea1
to
2266225
Compare
When we suspend we always try a lower level but we shouldn't try offscreen.
2266225
to
b1645e0
Compare
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.
lgtm!
When we suspend we always try a lower level but we shouldn't try offscreen.
When we suspend we always try a lower level but we shouldn't try offscreen.
When we suspend we always try a lower level but we shouldn't try offscreen.
If nothing pings during this time then we’ll never return back to rendering the smaller set. This leads us to overrender a lot and assume offscreen heuristics for visible content.
Offscreen really shouldn’t ever render unless we’ve committed everything else. There’s no reason to since hidden and hydrating work never unblocks anything.
This change makes it so we leave cpu cycles on the table. Ideally we could warm up hidden work and then return to the previously prepared tree but since we can’t do that yet it’s better to not throw away the tree.