Skip to content

Commit 6fd6cb0

Browse files
authored
v3: keep scoped macOS transforms parallel (#27980)
1 parent 229fc6e commit 6fd6cb0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

vlib/v3/driver/driver.v

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4455,11 +4455,13 @@ pub fn run(args []string) {
44554455
}
44564456
exit(1)
44574457
}
4458-
// Parallel transform is disabled for larger embedded imports to stay below
4459-
// 2 GiB. Cgen workers reconcile their local string IDs during the ordered
4460-
// merge, so embedded generation remains deterministic in parallel.
4458+
// Parallel transform is disabled for larger embedded imports when worker
4459+
// scratch allocations live for the whole compilation. Scoped preallocation
4460+
// releases that scratch after each stage, so it can retain parallel transform
4461+
// without the former memory growth. Cgen workers reconcile their local string
4462+
// IDs during the ordered merge, so embedded generation remains deterministic.
44614463
if !current_no_parallel && os.getenv(v3_embedded_env) == '1' {
4462-
if a.nodes.len >= embedded_parallel_transform_node_limit {
4464+
if !scope_prealloc_transform && a.nodes.len >= embedded_parallel_transform_node_limit {
44634465
current_parallel_transform = false
44644466
}
44654467
}

0 commit comments

Comments
 (0)