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:
Claude <noreply@anthropic.com>
Showing
This diff is collapsed.
Please
register
or
sign in
to comment