Commit afb866b7 authored by Tobias Koppers's avatar Tobias Koppers Committed by Tobias Koppers

turbo-tasks-backend: add batched N×M aggregation update for InnerOfUppersHasNewFollowers

Add `inner_of_uppers_has_new_followers` to handle the general case of
N uppers × M followers in a single batched pass. Previously this case
was handled by iteratively popping one element and re-enqueuing the
partially-processed job, causing redundant task reads and queue churn.

The new method builds a reverse index (upper → followers) so each
upper's task data is read only once per iteration, classifies all
followers as inner or follower edges in bulk, and retries any pairs
that get reclassified due to concurrent aggregation number changes.

Also simplifies the `InnerOfUppersHasNewFollowers` job dispatch:
replaces the mutable pop-and-re-enqueue loop with a `match` on
`(uppers.len(), followers.len())` that routes directly to the
appropriate specialized function ((1,1), (N,1), (1,M), or (N,M)).
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
parent 8919ce66
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment