You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The expected gain is 5% ~ 10% of total runtime. It's mainly due to less visit, and also due to parallelization being more efficient.
The text was updated successfully, but these errors were encountered:
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
changed the title
Move Pure optimizer into swc_ecma_transforms_optimization (5~10% of total runtime)
Move Pure optimizer into swc_ecma_transforms_optimizationJan 22, 2025
kdy1
linked a pull request
Jan 26, 2025
that will
close
this issue
After then, we can merge the logic of
expr_simplifier
anddead_branch_remover
into the pure optimizer.Pure optimizer: https://github.com/swc-project/swc/tree/8f8dcaac2f22f71de538802034db5756e84c7f55/crates/swc_ecma_minifier/src/compress/pure
Target directory: https://github.com/swc-project/swc/tree/8f8dcaac2f22f71de538802034db5756e84c7f55/crates/swc_ecma_transforms_optimization/src/simplify
Points
transform()
API of SWC supportssimplify
, so we can't simply move the logic ofexpr_simplifier
anddead_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.#![non_exhaustive]
, so adding a field is not a breaking change.The text was updated successfully, but these errors were encountered: