-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
Description
Context
In crates/rolldown/src/stages/scan_stage.rs:64-67, the make_copy() method used for incremental builds disables parallel iteration on macOS:
#[cfg(not(target_os = "macos"))]
let iter = self.index_ecma_ast.raw.par_iter();
#[cfg(target_os = "macos")]
let iter = self.index_ecma_ast.raw.iter();
let index_ecma_ast = iter
.map(|ast| ast.as_ref().map(rolldown_ecmascript::EcmaAst::clone_with_another_arena))
.collect::<Vec<_>>();clone_with_another_arena is an expensive operation (it clones the entire AST into a new allocator arena), and running it sequentially on macOS is a significant performance bottleneck for incremental builds. On non-macOS platforms, par_iter() is used, which distributes the cloning across threads.
Need to investigate why par_iter was disabled on macOS (likely an allocator or thread-safety issue with the arena allocator on macOS) and determine if it can be safely re-enabled.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Fields
Give feedbackPriority
None yet