Skip to content

Group propagated frontier changes by operator - #838

Draft
def- wants to merge 2 commits into
TimelyDataflow:masterfrom
def-:pr-progress-tick-perf
Draft

def- wants to merge 2 commits into
TimelyDataflow:masterfrom
def-:pr-progress-tick-perf

Conversation

@def-

@def- def- commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Tracker::propagate_all collected every frontier change of a scope in one ChangeBatch<(Location, T)>. The worklist produces changes in time order and the batch sorts by location, so the batch sorted its whole contents each time it doubled, and once more when drained. For a scope of 200 operators that sorting was 43% of the cost of advancing an input frontier. In continuous profiles of a production deployment, compaction of this batch type is about 3.5% of worker CPU.

The tracker now keeps one small batch per operator and a list of the operators that have changes. Changes still consolidate per location and time, so transient changes in cyclic scopes cancel as before, but no sort spans more than one operator. The operators listed are distinct, which also removes the sort of maybe_shutdown.

Breaking: Tracker::pushed now returns PushedChanges, which hands out the changes one operator at a time.

The first commit adds a progress_tick example that advances the inputs of dataflows carrying no data and reports nanoseconds per operator per tick. Median of five interleaved runs pinned to one core, x86-64, measured on top of v0.32.0:

dataflows x regions x operators before after change
1 x 1 x 200 332.7 252.0 -24.3%
100 x 5 x 10 829.2 722.6 -12.9%
100 x 1 x 200 729.7 623.3 -14.6%
1 x 1 x 100000 1000.5 719.9 -28.0%

A simpler variant that skipped consolidation entirely was faster still, but the reachability doc test showed transient changes in a cyclic graph no longer cancelling, so I did not pursue it.

🤖 Generated with Claude Code

def- and others added 2 commits November 19, 2026 15:16
`Tracker::propagate_all` collected every frontier change of a scope in one
`ChangeBatch<(Location, T)>`. The worklist produces changes in time order
and the batch sorts by location, so the batch sorted its whole contents
each time it doubled and once more when drained. For a scope of 200
operators that sorting was 43% of the cost of advancing an input frontier.

The tracker now keeps one small batch per operator, and a list of the
operators that have changes. Changes still consolidate per location and
time, so transient changes in cyclic scopes cancel as before, but no sort
spans more than one operator. The operators listed are distinct, which
also removes the sort of `maybe_shutdown`.

`Tracker::pushed` now returns `PushedChanges`, which hands out the changes
one operator at a time. This is a breaking change for callers of `pushed`.

Measured with the new `progress_tick` example, which advances the inputs
of dataflows that carry no data and reports nanoseconds per operator per
tick. Median of five interleaved runs pinned to one core, x86-64:

    dataflows x regions x operators   before    after
    1 x 1 x 200                        332.7    252.0   -24.3%
    100 x 5 x 10                       829.2    722.6   -12.9%
    100 x 1 x 200                      729.7    623.3   -14.6%
    1 x 1 x 100000                    1000.5    719.9   -28.0%

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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