Skip to content

Commit 5117838

Browse files
committed
perf(es/minifier): Remove dead_branch_remover call
1 parent 4a6fe38 commit 5117838

File tree

1 file changed

+1
-37
lines changed
  • crates/swc_ecma_minifier/src/compress

1 file changed

+1
-37
lines changed

crates/swc_ecma_minifier/src/compress/mod.rs

+1-37
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ use std::{borrow::Cow, time::Instant};
88
use pretty_assertions::assert_eq;
99
use swc_common::pass::{CompilerPass, Repeated};
1010
use swc_ecma_ast::*;
11-
use swc_ecma_transforms_optimization::simplify::{
12-
dead_branch_remover, expr_simplifier, ExprSimplifierConfig,
13-
};
11+
use swc_ecma_transforms_optimization::simplify::{expr_simplifier, ExprSimplifierConfig};
1412
use swc_ecma_usage_analyzer::marks::Marks;
1513
use swc_ecma_visit::VisitMutWith;
1614
#[cfg(debug_assertions)]
@@ -250,40 +248,6 @@ impl Compressor<'_> {
250248
// let done = dump(&*n);
251249
// debug!("===== Result =====\n{}", done);
252250
}
253-
254-
if self.options.conditionals || self.options.dead_code {
255-
#[cfg(feature = "debug")]
256-
let start = dump(&*n, false);
257-
258-
let start_time = now();
259-
260-
let mut v = dead_branch_remover(self.marks.unresolved_mark);
261-
n.visit_mut_with(&mut v);
262-
263-
if let Some(start_time) = start_time {
264-
let end_time = Instant::now();
265-
266-
tracing::info!(
267-
"compress: dead_branch_remover took {:?} (pass = {})",
268-
end_time - start_time,
269-
self.pass
270-
);
271-
}
272-
273-
#[cfg(feature = "debug")]
274-
{
275-
let simplified = dump(&*n, false);
276-
277-
if start != simplified {
278-
debug!(
279-
"===== Removed dead branches =====\n{}\n==== ===== ===== ===== ======\n{}",
280-
start, simplified
281-
);
282-
}
283-
}
284-
285-
self.changed |= v.changed();
286-
}
287251
}
288252
}
289253

0 commit comments

Comments
 (0)