Cache bundle analysis per output file (#100475)
## Summary Analyze each emitted and traced file once in a cached task that returns its filename, chunk membership, and chunk parts with normalized sources and compressed sizes. Routes previously made 3–5 task calls per shared file, and task-graph bookkeeping for those calls dominated analysis. Splitting, compression, and membership enumeration run as plain helpers under that task, since each is read once. Measured on v0/chat with `next build --analyze` (#99962), analysis phase only: new tasks went from 269k to 242k, calls into existing tasks from 8.49M to 5.07M, and median CPU time from 150s to 124s. All 455 data artifacts were byte-identical across 12 runs. Supersedes #100486. ## Verification - `cargo test -p turbopack-analyze --test split_chunk` and `cargo test -p next-api --lib analyze` passed. - Rebuilt the native binding with `release-with-debug`, installed it in v0/chat, and compared `next build --analyze` output against the previous binary across alternating runs. <!-- NEXT_JS_LLM -->
Showing
Please
register
or
sign in
to comment