Repository navigation
Conversation
… deduplicating `propagate_pointstamps` collected the node of every pushed change into `maybe_shutdown` and then sorted and deduplicated it. A per-child flag now lists each node once, as it is first seen. The candidates feed a binary heap, so their order does not matter.
This branch has not been deployed
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.
Problem
Subgraph::propagate_pointstampspushes the node of every change the tracker pushes intomaybe_shutdown, then sorts and deduplicates it. A node appears once per changed port and time, so the vector holds many duplicates, and the sort costs more when the pushed changes are not ordered by location (as with #828).Change
A
Vec<bool>per child records whether the child is already inmaybe_shutdown. A child is listed when first seen, and its flag is cleared as the list is drained. The sort anddedupare removed.Why results and progress semantics are unchanged
The same set of children is considered, each once, against the same tracker state. Children that qualify go into
temp_active, aBinaryHeap, so the order of consideration has no effect.Measurements
With the
progress_roundsexample from #828, one worker, pinned,perf staton a c7a.8xlarge, medians of 3 runs:masterchain 100 20000chain 10 100000loop 20 20000On
masteralone the effect is small and within the noise in time, because the pushed changes arrive sorted by location, so the sort is cheap. With #828 the pushed changes arrive in component order, and this change saves 2–4% of instructions and 2–6% of time on the chains. In FlowLog it was measured only together with #828 (see there).Testing
cargo test --workspace --all-targetsandcargo test --docpass (234 tests).cargo clippy --workspace --all-targetsreports the same warnings asmaster.