Unverified Commit 133d3d1f authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Emit build output without EntrypointsOperation

`emit_all_output_assets_once_with_issues_operation` wrapped the emit
operation in `EntrypointsOperation::new`, only to discard the resulting
entrypoints. That created one `pick_endpoint` root operation per
endpoint (~6,000 in a large app), each becoming a new aggregation upper
of the whole emit graph and copying its collectibles. In
`bench/nested-deps-app-router-many-pages` at 32 CPUs this kept the end
of the emit phase at ~4.5 busy cores.

Read the emit operation directly instead. The issues and effects are
still collected from the same operation.

On canary 8521c6ae, 32 CPUs, 4 interleaved rounds, median paired
change vs. canary: turbopack-emit -62.3% (12.3 s -> 4.5 s),
"Compiled in" -19.1%, wall -15.1%. `.next` output and build issues
are unchanged.
Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent 8521c6ae
......@@ -1722,15 +1722,18 @@ async fn emit_all_output_assets_once_with_issues_operation(
let start = Instant::now();
let wall_start = SystemTime::now();
let result = async {
let entrypoints_operation =
EntrypointsOperation::new(emit_all_output_assets_once_operation(
container,
app_dir_only,
has_deferred_entrypoints,
));
// Read the emit operation directly. Wrapping it in `EntrypointsOperation::new` would
// create one `pick_endpoint` root operation per endpoint, each of which becomes a new
// aggregation upper of the whole emit graph, while the entrypoints value is discarded
// here anyway.
let emit_operation = emit_all_output_assets_once_operation(
container,
app_dir_only,
has_deferred_entrypoints,
);
let filter = container.project().issue_filter().await?;
let (_, issues, effects) =
strongly_consistent_catch_collectables(entrypoints_operation, &filter).await?;
strongly_consistent_catch_collectables(emit_operation, &filter).await?;
Ok(OperationResult { issues, effects }.cell())
}
.await;
......
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