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

feat(es/minifier): Drop expressions using sequential inliner #6936

Merged
merged 26 commits into from Apr 29, 2023

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Feb 13, 2023

Description:

I'm trying to optimize

import { upper } from "module";
let foobar = "foo";
export const foo = foobar;
const bar = "bar";
foobar += bar;
let foobarCopy = foobar;
foobar += "foo";
console.log(foobarCopy);
foobarCopy += "Unused";
function internal() {
    return upper(foobar);
}

Theoretically, a control flow graph is required for this optimization. But our sequential inliner shares some characteristics with it, so I'm investigating to check if this optimization is possible without a full control flow graph.

Related issue (if exists):

@kdy1 kdy1 requested a review from jridgewell April 20, 2023 04:47
@kdy1 kdy1 marked this pull request as ready for review April 20, 2023 04:47
@kdy1
Copy link
Member Author

kdy1 commented Apr 20, 2023

This is now ready for review, but I'll wait as much as possible

Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_ecma_minifier

@kdy1 kdy1 enabled auto-merge (squash) April 29, 2023 11:49
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 disabled auto-merge April 29, 2023 13:18
@kdy1 kdy1 merged commit 246300a into swc-project:main Apr 29, 2023
127 checks passed
@kdy1 kdy1 deleted the dce-test branch April 29, 2023 13:19
@kdy1 kdy1 modified the milestones: Planned, v1.3.56 Apr 29, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants