Skip to content

[compiler] add fixture for optimization across scopes #29998

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

Merged
merged 8 commits into from
Jun 21, 2024

Conversation

josephsavona
Copy link
Member

@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: 4d0c533
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: 3ec7f6d
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: d92c6d9
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: dc6143f
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: 05f3dda
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: 78d1cae
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: f8107b0
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: e637a38
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: e637a38
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