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

Move Pure optimizer into swc_ecma_transforms_optimization #9926

Open
kdy1 opened this issue Jan 22, 2025 · 0 comments · May be fixed by #9946
Open

Move Pure optimizer into swc_ecma_transforms_optimization #9926

kdy1 opened this issue Jan 22, 2025 · 0 comments · May be fixed by #9946

Comments

@kdy1
Copy link
Member

kdy1 commented Jan 22, 2025

After then, we can merge the logic of expr_simplifier and dead_branch_remover into the pure optimizer.

Points

  • This task is required because of the versioning issue. transform() API of SWC supports simplify, so we can't simply move the logic of expr_simplifier and dead_branch_remover to the pure optimizer.

Instead, we need to move the pure optimizer to the simplifier first, and use it for the simplify option. After then, merging logic will be safe.

  • The configuration for pure optimizer should use #![non_exhaustive], so adding a field is not a breaking change.

Image

  • The expected gain is 5% ~ 10% of total runtime. It's mainly due to less visit, and also due to parallelization being more efficient.
@kdy1 kdy1 changed the title Move Pure optimizer into swc_ecma_transforms_optimization Move Pure optimizer into swc_ecma_transforms_optimization (5~10% of total runtime) Jan 22, 2025
@kdy1 kdy1 changed the title Move Pure optimizer into swc_ecma_transforms_optimization (5~10% of total runtime) Move Pure optimizer into swc_ecma_transforms_optimization Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant