next.js
7211bfcc - next-api: isolate dropped entrypoint collectibles in an inner operation (#100187)

Commit
31 days ago
next-api: isolate dropped entrypoint collectibles in an inner operation (#100187) > [!NOTE] > Stacked on #100165. Compare against `codex/net-collectibles-in-from-task`. ### What? Split `entrypoints_without_collectibles_operation` into two root operations: - **`inner_entrypoints_without_collectibles_operation`**, a function nested inside the outer operation, contains the previous body: `strongly_consistent` resolve, `drop_issues()`, `take_effects()`, then `connect()`. Its long name is kept so it is easy to identify in traces. - **`entrypoints_without_collectibles_operation`** keeps its name and signature, and only connects the inner operation. `EntrypointsOperation::new` and all `pick_*` operations are unchanged. ### Why? During `next build`, ~6,000 `pick_*` root operations connect to `entrypoints_without_collectibles_operation`. - **Problem:** that task drops the issues and takes the effects of the entrypoints subgraph. It therefore holds an own negative count for each of them alongside the positive aggregated counts. Each new `pick_*` upper receives a copy of all of those collectibles. #100165 nets them outside the follower lock, but the copy remains. - **Fix:** moving the drop/take into an inner root operation keeps those negative counts in the inner task. The outer task, which the `pick_*` roots connect to, should then have no (or only very few) collectibles to copy into each of them. This is reasoning from the code; I didn't measure the per-task collectible counts. ### How? **Measurement** against #100165 (`acba773c`): `bench/nested-deps-app-router-many-pages`, 32 CPUs, cold untraced `next build`, 1 warm-up plus 4 interleaved rounds per arm. | Metric | #100165 median | this PR median | median paired change | |---|---:|---:|---:| | `turbopack-emit` | 8.27 s | 5.24 s | **−37.5%** | | "Compiled in" | 29.85 s | 26.80 s | −10.2% | | wall | 50.51 s | 46.55 s | −7.9% | All three metrics were faster in all 4 rounds. **Equivalence with #100165:** - The `.next` output has the same file set. After normalizing build IDs and timings, only the known per-build random keys differ. - Warning and error fixtures produce identical normalized issue output. **Local checks:** `pnpm build-all` passes (18/18 tasks), as do `next-api` clippy with `-D warnings` and rustfmt. **Limitations:** - One VM and four rounds, with no significance test. - I didn't add a trace or a direct collectible-count probe. - I didn't test dev/HMR or incremental rebuilds locally. <!-- NEXT_JS_LLM --> <!-- fleet d8fee2f9-18db-4936-b59a-f8417b8f4bbc --> --------- Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
Author
Parents
Loading