Skip to content

perf: dep_graph: stop collecting edges in the green marking walk [-1.70% incr-unchanged] - #58

Draft
xmakro wants to merge 1 commit into
perf/carry-unchanged-nodesfrom
perf/dep-graph-skip-edge-collection
Draft

perf: dep_graph: stop collecting edges in the green marking walk [-1.70% incr-unchanged]#58
xmakro wants to merge 1 commit into
perf/carry-unchanged-nodesfrom
perf/dep-graph-skip-edge-collection

Conversation

@xmakro

@xmakro xmakro commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Based on the parent branch perf/carry-unchanged-nodes, where dep-graph indices hold still across sessions and an unchanged node's record is re-emitted from the previous file.

Marking a node green walks its previous dependencies and, on the way, copies each dependency's current index into a scratch buffer. That buffer exists for one reason: to hand the encoder an edge list for the node it is about to write.

The encoder no longer reads it. A promoted record comes out of the previous file as it stands, edges included. The one remaining reader is the debugging graph behind -Zquery-dep-graph, and it can take the edges off the previous graph instead: every target of a promoted node is green, and a green node keeps its previous index, so the current edge list is the previous one unchanged.

So the walk stops collecting. This removes a store per edge from the hottest incremental path, along with the per-node edge frame and its drop, the per-worker buffer behind it, and the edge list threaded through promotion.

Local A/B against the parent branch, six primary crates, instructions:u, jemalloc preloaded, both sides built from an identical bootstrap.toml:

scenario delta
incr-unchanged -1.70%
incr-patched -1.06%
full / incr-full +0.03% / -0.01% (control)

43 of 81 cells improved by at least 0.25%, 0 regressed. Best cells: cargo debug incr-unchanged -2.22%, syn debug incr-unchanged -1.97%, regex-automata debug incr-unchanged -1.91%.

Validation, with debug assertions and overflow checks armed: tests/incremental 178 passed and 0 failed, of which the 93 tests that pass -Zquery-dep-graph exercise the reconstructed edge lists. Sixteen generations of churn and deletion stress in each of four modes (default, -Zincremental-verify-ich, -Zthreads=8, and both together) came back clean, including the warning-replay oracle, and a multi-generation -Zquery-dep-graph build is clean as well.

@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
@xmakro
xmakro marked this pull request as draft July 28, 2026 11:01
@xmakro
xmakro force-pushed the perf/dep-graph-skip-edge-collection branch from 2cf8195 to 06d36cd Compare August 5, 2026 07:06
@xmakro xmakro changed the title perf: dep_graph: skip edge collection in the marking walk when carrying [-1.54% incr-unchanged] perf: dep_graph: stop collecting edges in the green marking walk Aug 5, 2026
@xmakro
xmakro changed the base branch from perf/dep-graph-append-only to perf/carry-unchanged-nodes August 5, 2026 07:07
@xmakro xmakro changed the title perf: dep_graph: stop collecting edges in the green marking walk perf: dep_graph: stop collecting edges in the green marking walk [-1.70% incr-unchanged] Aug 5, 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