-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
perf(es/minifier): Merge dead_branch_remover
into pure optimizer
#10201
Conversation
🦋 Changeset detectedLatest commit: b02ff3d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #10201 will improve performances by 2.18%Comparing Summary
Benchmarks breakdown
|
f53f9f0
to
e5ca81e
Compare
980e2f4
to
97f2180
Compare
66c8d74
to
99d30b3
Compare
d958be4
to
a650278
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates the functionality of dead_branch_remover into the pure optimizer to enable parallel processing and reduce visitor pattern overhead. Key changes include updating test snapshot sizes, adjusting control flow constructs in various minified test files, and refactoring duration formatting in the output index file.
Reviewed Changes
Copilot reviewed 104 out of 105 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
crates/swc/tests/libs-size.snapshot.md | Minor numeric adjustments in file sizes for several JS files |
.changeset/wild-berries-divide.md | Adds a changeset to document version bumps and the perf related change |
crates/swc/tests/tsc-references/*.minified.js | Updates control flow labels and statement formatting in test references |
crates/swc/tests/vercel/full/ms/1/output/index.ts | Refactors helper function name and error handling in duration formatting |
crates/swc/tests/tsc-references/parserindenter.2.minified.js | Reformats nested if blocks for indentation handling |
crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility.2.minified.js | Updates chain assignment order for object members |
Files not reviewed (1)
- crates/swc_ecma_minifier/scripts/test.sh: Language not supported
Comments suppressed due to low confidence (2)
crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersAccessibility.2.minified.js:4
- The chain assignment for the second block appears truncated compared to the original version. Verify if the removal of assignments for e1 is intentional to maintain the intended behavior.
TargetIsPublic || (TargetIsPublic = {}), a = b, a = i, a = d, b = a = e, b = i, b = d, b = e, i = a, i = b, i = d, i = e, d = a, d = b, d = i, d = e, e = a, e = b, e = i, e = d, TargetIsPublic || (TargetIsPublic = {}), a1 = b1, a1 = i1, a1 = d1, b1 = a1 = e1, b1 = i1, b1 = d1, b1 = e1, i1 = a1, i1 = b1, i1 = d1, i1 = e1, d1 = a1, d1 = b1, d1 = i1;
crates/swc/tests/tsc-references/parser_continueTarget3.2.minified.js:2
- Replacing 'for(;;)continue;' with 'for(;;);' removes the continue statement, which may alter the loop’s behavior. Please verify that this change is intentional.
for(;;);
@@ -1,2 +1,2 @@ | |||
var a = (()=>"expected")(); | |||
var a = (()=>true ? "expected" : "unexpected1")(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires merging expr_simplifier
into the pure minifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swc-project/core-es Can you review only rust code? I'm checking test diffs
dead_branch_remover
calldead_branch_remover
into pure optimizer
**Description:** `styled-jsx` passes typescript input to the `Evaluator`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this, but feel free to left a review as I can invert PR afterwards.
Description:
Merge
dead_branch_remover
into the pure optimizer to make sequential process parallel and reduce the overhead of the visitor pattern.Related issue:
dead_branch_remover
#10217 because we don't use it for minifier anymore.