perf: concatenate per-chunk Schur edge lists in one pre-sized copy - #255
Merged
Conversation
schroedk
force-pushed
the
perf/par-emit-collect
branch
from
August 13, 2026 11:40
3a0a57c to
e82fb90
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
par_emitcollected sampled star edges withreduce(Vec::new, |a, b| a.append(b)), so rayon's reduction tree recopied every edge once per level. Collecting the chunks and callingconcat()copies each edge exactly once into one pre-sized allocation.Setup time on
fixest_comparison, interleaved rounds with a rebuild between arms:LSMR(exact)(null control)LSMR(approx)LSMR(2-2)Run ranges separate at 5M and 20M for
approx, and at every size for2-2.Scope: null on
slopes,akm_panel,akm_scalingand six small-problem suites — Schur assembly is ~30% of within CPU on fixest-difficult 3FE but only 5-7% there. No regression in any suite measured.Results are unchanged:
sort_and_dedupimposes a total(lo, hi, weight)order immediately after, and iteration counts are bit-identical across every case/config pair in all runs.Note: 5% sits inside this repo's normal noise band, so reproducing it needs the interleaved protocol — a casual before/after will not show it.