Skip to content

Commit

Permalink
perf(es/renamer): Modify parallel renaming threshold (#9706)
Browse files Browse the repository at this point in the history
**Related issue:**

 - #9601
  • Loading branch information
kdy1 authored Nov 2, 2024
1 parent dd25ecf commit 91a9106
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/swc_ecma_transforms_base/src/rename/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ where
}

fn visit_mut_expr_or_spreads(&mut self, n: &mut Vec<ExprOrSpread>) {
self.maybe_par(cpu_count() * 8, n, |v, n| {
self.maybe_par(cpu_count() * 100, n, |v, n| {
n.visit_mut_with(v);
})
}

fn visit_mut_exprs(&mut self, n: &mut Vec<Box<Expr>>) {
self.maybe_par(cpu_count() * 8, n, |v, n| {
self.maybe_par(cpu_count() * 100, n, |v, n| {
n.visit_mut_with(v);
})
}
Expand Down Expand Up @@ -488,7 +488,7 @@ where
}

fn visit_mut_opt_vec_expr_or_spreads(&mut self, n: &mut Vec<Option<ExprOrSpread>>) {
self.maybe_par(cpu_count() * 8, n, |v, n| {
self.maybe_par(cpu_count() * 100, n, |v, n| {
n.visit_mut_with(v);
})
}
Expand Down Expand Up @@ -523,7 +523,7 @@ where
}

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

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

Expand Down Expand Up @@ -597,7 +597,7 @@ where
}

fn visit_mut_var_declarators(&mut self, n: &mut Vec<VarDeclarator>) {
self.maybe_par(cpu_count() * 8, n, |v, n| {
self.maybe_par(cpu_count() * 100, n, |v, n| {
n.visit_mut_with(v);
})
}
Expand Down

0 comments on commit 91a9106

Please sign in to comment.