Skip to content

perf: dep_graph: skip edge collection in the marking walk when carrying [-1.54% incr-unchanged]#58

Open
xmakro wants to merge 2 commits into
perf/dep-graph-append-onlyfrom
perf/dep-graph-skip-edge-collection
Open

perf: dep_graph: skip edge collection in the marking walk when carrying [-1.54% incr-unchanged]#58
xmakro wants to merge 2 commits into
perf/dep-graph-append-onlyfrom
perf/dep-graph-skip-edge-collection

Conversation

@xmakro

@xmakro xmakro commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Based on #44 (append-only save via wholesale carry of the record region). Split out of that PR to be measurable on its own; independent of the serve-edges-in-place sibling PR #59.

With the record region carried forward, promoting a green node no longer consumes its edge list: the record is already in the new file. The marking walk still collected every dependency's index into a buffer purely to hand it to the encoder. Add a non-collecting variant of the walk for carried sessions that verifies dependency colors and promotes with just the color-map insert — no store per edge, no per-node edge-frame bookkeeping in the hottest incremental path. Compacting sessions keep the collecting walk, whose encoder still needs the edges.

Local rustc-perf (primary crates, instructions:u), this change alone against the #44 branch:

scenario delta
incr-unchanged -1.54%
incr-patched -0.96%
full / incr-full -0.04% / -0.03% (control)

28 of 60 cells improved by at least 0.25%, 0 regressed (best: cargo debug incr-unchanged -1.98%).

Validation: 20 generations each of incr-unchanged, of alternating real edits, and of alternating edits under -Zincremental-verify-ich, all crossing the compaction boundary: every generation clean.

xmakro and others added 2 commits July 25, 2026 15:13
Compaction was triggered only by a fixed generation cap: after eight carried
generations the file is rewritten fresh, whatever its actual state. Track the
live record bytes exactly in the footer, as an O(changed) delta like the other
counts, and rewrite once the record region exceeds twice its live bytes.
High-churn graphs compact as often as before, while low-churn graphs carry for
up to sixteen generations instead of eight, avoiding the periodic compaction
spikes the fixed cap forced on them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With the record region carried forward, promoting a green node no longer
consumes its edge list: the record is already in the new file. The marking
walk still collected every dependency's index into a buffer purely to hand
it to the encoder. Add a non-collecting variant of the walk for carried
sessions that verifies dependency colors and promotes with just the
color-map insert, eliminating a store per edge and the per-node edge-frame
bookkeeping from the hottest incremental path. Compacting sessions keep
the collecting walk, whose encoder still needs the edges.

Local measurement on top of the region carry: the walk's self cost on a
dep-graph-heavy incr-unchanged rebuild drops by about a quarter, and
multi-generation medians improve by up to another 1.5% (match-stress) and
0.9% (hyper incr-patched). 12 generations of incr-unchanged, of alternating
real edits, and of -Zincremental-verify-ich all pass; tests/incremental
passes in full.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 876ef96)
@xmakro xmakro changed the title perf: dep_graph: skip edge collection in the marking walk when carrying perf: dep_graph: skip edge collection in the marking walk when carrying [-1.54% incr-unchanged] Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant