Skip to content

compiler: Scope-based reordering #29803

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

Closed

Conversation

josephsavona
Copy link
Member

@josephsavona josephsavona commented Jun 7, 2024

Stack from ghstack (oldest at bottom):

Extends instruction reordering further to allow reordering of instructions in different scopes. The basic idea is that each instructions within a scope maintain their original order with respect to each other, but instructions for different scopes can be reordered relative to other scopes. This allows interleaved or nested scopes to be reordered to avoid the interleaving/nesting.

There are lot of things still very broken about this, but the one new fixture shows an example of this working.

Note that this approach works very well for interleaving. We'll probably need to add a bit more to handle nesting - in general it's better to move nested scopes first before their parent scope, but the current algorithm for reordering doesn't take this into account yet.

Extends instruction reordering further to allow reordering of instructions in different scopes. The basic idea is that each instructions within a scope maintain their original order with respect to each other, but instructions for different scopes can be reordered relative to other scopes. This allows interleaved or nested scopes to be reordered to avoid the interleaving/nesting.

There are lot of things still very broken about this, but the one new fixture shows an example of this working.

Note that this approach works very well for interleaving. We'll probably need to add a bit more to handle nesting - in general it's better to move nested scopes first before their parent scope, but the current algorithm for reordering doesn't take this into account yet.

[ghstack-poisoned]
Copy link

vercel bot commented Jun 7, 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 Jun 7, 2024 5:33pm

josephsavona added a commit that referenced this pull request Jun 7, 2024
Extends instruction reordering further to allow reordering of instructions in different scopes. The basic idea is that each instructions within a scope maintain their original order with respect to each other, but instructions for different scopes can be reordered relative to other scopes. This allows interleaved or nested scopes to be reordered to avoid the interleaving/nesting.

There are lot of things still very broken about this, but the one new fixture shows an example of this working.

Note that this approach works very well for interleaving. We'll probably need to add a bit more to handle nesting - in general it's better to move nested scopes first before their parent scope, but the current algorithm for reordering doesn't take this into account yet.

ghstack-source-id: 9dc8e62
Pull Request resolved: #29803
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Jun 7, 2024
@react-sizebot
Copy link

Comparing: c4b433f...86b0af8

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 = 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 497.26 kB 497.26 kB = 89.11 kB 89.11 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 502.08 kB 502.08 kB = 89.80 kB 89.80 kB
facebook-www/ReactDOM-prod.classic.js = 594.56 kB 594.56 kB = 104.72 kB 104.72 kB
facebook-www/ReactDOM-prod.modern.js = 570.95 kB 570.95 kB = 101.13 kB 101.13 kB
test_utils/ReactAllWarnings.js Deleted 63.89 kB 0.00 kB Deleted 15.97 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 63.89 kB 0.00 kB Deleted 15.97 kB 0.00 kB

Generated by 🚫 dangerJS against 86b0af8

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