Prefetch scheduler mirrors the navigation's tree walk (#98975)
The prefetch scheduler's static walk decided at the parent which child was still part of the current page and which began the new part of the route, and it fetched the head through two functions of its own that copied the per-segment decision (a static attempt, then a runtime deopt if that wasn't enough) for a node that hangs off the route root instead of sitting in the tree. Give the walk the same shape as the navigation's. The walk over the part of the route the current page also has owns the comparison for its own node — first whether the route position still matches, then whether any of its params changed — and hands off to the walk over the new part of the route when either fails, so the root enters the shared walk like every other node. The per-segment decision, a static attempt or a runtime deopt, lives in one function that the new-part walk calls for every segment, and the runtime request's walk gets the same split between iterating the children and deciding for one node. The head is a one-node route tree like any other segment now, so it goes through the same functions: the new-part static walk and the direct runtime fetch it already had. This is a pure restructuring and issues the same requests as before: a segment the navigation keeps is still prefetched at the ordinary static tier without a runtime deopt, the head is still fetched whenever anything is, and a chain of inlined segments is still dropped where a Shell-phase walk crosses from a kept node into the new part. A later change uses the shape to prefetch only what the navigation would fetch.
Showing
This diff is collapsed.
Please
register
or
sign in
to comment