Skip to content

Commit 46ef447

Browse files
Boshenclaude
andcommitted
perf: enable parallel AST cloning on macOS
Remove the `#[cfg(target_os = "macos")]` guard that forced sequential iteration for `clone_with_another_arena` in incremental builds. Benchmarking on macOS shows par_iter is ~2.3x faster than sequential iter (3.87ms vs 8.82ms for 500 ASTs). The original concern from #6167 is no longer reproducible. Closes #8630 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 943fe8d commit 46ef447

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

crates/rolldown/src/stages/scan_stage.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::{sync::Arc, thread};
33
use arcstr::ArcStr;
44
use futures::future::join_all;
55
use oxc_index::IndexVec;
6-
#[cfg(not(target_os = "macos"))]
76
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
87
use rolldown_common::SourceMapGenMsg;
98
use rolldown_common::{
@@ -61,10 +60,7 @@ impl NormalizedScanStageOutput {
6160
Self {
6261
module_table: self.module_table.clone(),
6362
index_ecma_ast: {
64-
#[cfg(not(target_os = "macos"))]
6563
let iter = self.index_ecma_ast.raw.par_iter();
66-
#[cfg(target_os = "macos")]
67-
let iter = self.index_ecma_ast.raw.iter();
6864

6965
let index_ecma_ast = iter
7066
.map(|ast| ast.as_ref().map(rolldown_ecmascript::EcmaAst::clone_with_another_arena))

0 commit comments

Comments
 (0)