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

[compiler] add fixture for optimization across scopes #29998

Merged
merged 8 commits into from
Jun 21, 2024

Conversation

josephsavona
Copy link
Contributor

@josephsavona josephsavona commented Jun 21, 2024

Stack from ghstack (oldest at bottom):

Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

Copy link

vercel bot commented Jun 21, 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 21, 2024 11:52pm

josephsavona added a commit that referenced this pull request Jun 21, 2024
ghstack-source-id: 4d0c53335dc649065162a156a8cb1ccd22f6de75
Pull Request resolved: #29998
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Jun 21, 2024
@react-sizebot
Copy link

react-sizebot commented Jun 21, 2024

Comparing: 0f56841...137e4f0

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.93 kB 497.93 kB = 89.26 kB 89.26 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 502.75 kB 502.75 kB = 89.96 kB 89.96 kB
facebook-www/ReactDOM-prod.classic.js = 597.17 kB 597.17 kB = 105.33 kB 105.33 kB
facebook-www/ReactDOM-prod.modern.js = 571.52 kB 571.52 kB = 101.27 kB 101.27 kB
test_utils/ReactAllWarnings.js Deleted 62.88 kB 0.00 kB Deleted 15.69 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 62.88 kB 0.00 kB Deleted 15.69 kB 0.00 kB

Generated by 🚫 dangerJS against 137e4f0

Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: 3ec7f6d7649c9e5cbf5835f238bda2b4dbaf7fb6
Pull Request resolved: #29998
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: d92c6d91700ad107882ba795e18416b3f587dae9
Pull Request resolved: #29998
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: dc6143fd160ec727779d3a47645a5e723c1c5bc7
Pull Request resolved: #29998
Copy link
Contributor

@mofeiZ mofeiZ left a comment

Choose a reason for hiding this comment

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

Makes a lot of sense! I would be curious about the breakdown of the additional cost of not merging these scopes -- is it equal amounts of 1.) minified codesize, 2.) additional stack / locals allocations and JS-engine exec cost, and 3.) additional memo cache slots?

If we believe regressions are mostly coming from the last category, I wonder if we should also focus on optimizations along the lines of deduping dependency checking + caching across scopes. This would of course be limited to control flow boundaries (e.g. we wouldn't be able to dedupe across early returns).

Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: 05f3ddaa98f3f937777dc963ef25912be4281045
Pull Request resolved: #29998
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: 78d1cae17b7d1ac029165907955aac80a90272ea
Pull Request resolved: #29998
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: f8107b02cee076667682a54c4c7387398ca2639d
Pull Request resolved: #29998
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: e637a3814077559a1a56724eafe2567efed0b8d7
Pull Request resolved: #29998
@josephsavona josephsavona merged commit 2b49a90 into gh/josephsavona/32/base Jun 21, 2024
11 of 34 checks passed
josephsavona added a commit that referenced this pull request Jun 21, 2024
Adds a fixture based on internal case where our current output is quite a bit more verbose than the original memoization. See the comment in the fixture for more about the heuristic we can apply.

ghstack-source-id: e637a3814077559a1a56724eafe2567efed0b8d7
Pull Request resolved: #29998
@josephsavona josephsavona deleted the gh/josephsavona/32/head branch June 21, 2024 23:48
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.

4 participants