From e82fb90c544627822a40bcd45f91ea7b945fd3ad Mon Sep 17 00:00:00 2001 From: Kristof Schroeder Date: Thu, 13 Aug 2026 12:06:48 +0200 Subject: [PATCH] perf: concatenate per-chunk Schur edge lists in one pre-sized copy --- crates/within/src/block_elim/schur.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/within/src/block_elim/schur.rs b/crates/within/src/block_elim/schur.rs index 77d0e90..70569e5 100644 --- a/crates/within/src/block_elim/schur.rs +++ b/crates/within/src/block_elim/schur.rs @@ -354,10 +354,9 @@ fn par_emit(matrix: &SddmMatrix, config: &ApproxSchurConfig) -> Vec { }, ) .map(|work| work.edges) - .reduce(Vec::new, |mut a, mut b| { - a.append(&mut b); - a - }); + // Pre-sized single copy; a `reduce` tree of `append`s recopies each edge per level. + .collect::>() + .concat(); if let Some(ground) = ground_vertex { edges.extend( matrix