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

[Fiber] use unique flag for ShouldSuspendCommit #29220

Closed
wants to merge 1 commit into from

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented May 22, 2024

Previously ShouldSuspendCommit was sharing the bit with Visibility. However now that we enter the suspend loop during commit anytime this flag is set it means we might be doing this traversal more often than needed given the prevalent use of Visibility with Suspense.

To avoid unecessarily recursing here this change moves this flag to it's own bit. We're quite low on bits but we still have a couple more so instead of looking for a different suitable flag to share with Visibility I'm just consuming a new one. (Sorry future React person who eventually has to solve this)

Previously ShouldSuspendCommit was sharing the bit with Visibility. However now that we enter the suspend loop during commit anytime this flag is set it means we might be doing this traversal more often than needed given the prevalent use of Visibility with Suspense.

To avoid unecessarily recursing here this change moves this flag to it's own bit. We're quite low on bits but we still have a couple more so instead of looking for a different suitable flag to share with Visibility I'm just consuming a new one. (Sorry future React person who eventually has to solve this)
Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:18pm

@react-sizebot
Copy link

Comparing: 3ac551e...57b8622

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.66 kB 6.66 kB +0.16% 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 495.89 kB 495.91 kB = 88.82 kB 88.83 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB +0.11% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 500.69 kB 500.71 kB = 89.51 kB 89.51 kB
facebook-www/ReactDOM-prod.classic.js = 593.05 kB 593.07 kB +0.01% 104.32 kB 104.33 kB
facebook-www/ReactDOM-prod.modern.js = 569.27 kB 569.29 kB +0.01% 100.72 kB 100.73 kB
test_utils/ReactAllWarnings.js Deleted 64.35 kB 0.00 kB Deleted 16.05 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 64.35 kB 0.00 kB Deleted 16.05 kB 0.00 kB

Generated by 🚫 dangerJS against 57b8622

@gnoff
Copy link
Collaborator Author

gnoff commented May 22, 2024

turns out the shared bit is better: #29222

@gnoff gnoff closed this May 22, 2024
@gnoff gnoff deleted the use-unique-bit-for-suspense branch May 22, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants