perf(minifier): remove late optimization pass#12670
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #12670 will improve performances by 5.98%Comparing Summary
Benchmarks breakdown
Footnotes |
64cc2f5 to
85aaa66
Compare
85aaa66 to
7958e4e
Compare
Merge activity
|
There was a problem hiding this comment.
Pull Request Overview
This PR removes the late optimization pass from the minifier, consolidating optimizations into a single pass to simplify the architecture. The change moves several optimization methods from LatePeepholeOptimizations into the main PeepholeOptimizations pass and removes the separate late pass entirely.
- Removes the
LatePeepholeOptimizationsstruct and its separate traversal pass - Moves optimization methods from late pass into the main
PeepholeOptimizationsimplementation - Consolidates spread argument removal into the main call/new expression handlers
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_minifier/src/compressor.rs | Removes the late optimization pass call from the compression pipeline |
| crates/oxc_minifier/src/peephole/mod.rs | Eliminates LatePeepholeOptimizations struct and merges its methods into PeepholeOptimizations |
| crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs | Moves optimization methods from late pass and integrates them into main expression handling |
| crates/oxc_minifier/src/peephole/remove_dead_code.rs | Moves dead code removal method from late pass to main implementation |
| crates/oxc_minifier/src/peephole/convert_to_dotted_properties.rs | Updates implementation to use PeepholeOptimizations instead of LatePeepholeOptimizations |
| } | ||
|
|
||
| impl<'a> LatePeepholeOptimizations { | ||
| pub fn remove_dead_code_exit_class_body(body: &mut ClassBody<'a>, _ctx: &mut Ctx<'a, '_>) { |
There was a problem hiding this comment.
The method remove_dead_code_exit_class_body should be moved to the PeepholeOptimizations impl block to maintain consistency with the consolidation pattern used elsewhere in this PR.
| pub fn remove_dead_code_exit_class_body(body: &mut ClassBody<'a>, _ctx: &mut Ctx<'a, '_>) { | |
| pub fn remove_dead_code_exit_class_body(&self, body: &mut ClassBody<'a>, _ctx: &mut Ctx<'a, '_>) { |
Probably an overkill?
7958e4e to
96b4009
Compare
Probably an overkill?

Probably an overkill?