Skip to content

Commit 91a9106

Browse files
authoredNov 2, 2024··
perf(es/renamer): Modify parallel renaming threshold (#9706)
**Related issue:** - #9601
1 parent dd25ecf commit 91a9106

File tree

1 file changed

+6
-6
lines changed
  • crates/swc_ecma_transforms_base/src/rename

1 file changed

+6
-6
lines changed
 

‎crates/swc_ecma_transforms_base/src/rename/ops.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ where
180180
}
181181

182182
fn visit_mut_expr_or_spreads(&mut self, n: &mut Vec<ExprOrSpread>) {
183-
self.maybe_par(cpu_count() * 8, n, |v, n| {
183+
self.maybe_par(cpu_count() * 100, n, |v, n| {
184184
n.visit_mut_with(v);
185185
})
186186
}
187187

188188
fn visit_mut_exprs(&mut self, n: &mut Vec<Box<Expr>>) {
189-
self.maybe_par(cpu_count() * 8, n, |v, n| {
189+
self.maybe_par(cpu_count() * 100, n, |v, n| {
190190
n.visit_mut_with(v);
191191
})
192192
}
@@ -488,7 +488,7 @@ where
488488
}
489489

490490
fn visit_mut_opt_vec_expr_or_spreads(&mut self, n: &mut Vec<Option<ExprOrSpread>>) {
491-
self.maybe_par(cpu_count() * 8, n, |v, n| {
491+
self.maybe_par(cpu_count() * 100, n, |v, n| {
492492
n.visit_mut_with(v);
493493
})
494494
}
@@ -523,7 +523,7 @@ where
523523
}
524524

525525
fn visit_mut_prop_or_spreads(&mut self, n: &mut Vec<PropOrSpread>) {
526-
self.maybe_par(cpu_count() * 8, n, |v, n| {
526+
self.maybe_par(cpu_count() * 100, n, |v, n| {
527527
n.visit_mut_with(v);
528528
})
529529
}
@@ -532,7 +532,7 @@ where
532532
use std::mem::take;
533533

534534
#[cfg(feature = "concurrent")]
535-
if nodes.len() >= 8 * cpu_count() {
535+
if nodes.len() >= 100 * cpu_count() {
536536
::swc_common::GLOBALS.with(|globals| {
537537
use rayon::prelude::*;
538538

@@ -597,7 +597,7 @@ where
597597
}
598598

599599
fn visit_mut_var_declarators(&mut self, n: &mut Vec<VarDeclarator>) {
600-
self.maybe_par(cpu_count() * 8, n, |v, n| {
600+
self.maybe_par(cpu_count() * 100, n, |v, n| {
601601
n.visit_mut_with(v);
602602
})
603603
}

0 commit comments

Comments
 (0)
Please sign in to comment.