Unverified Commit 5db5f136 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

[Turbopack] make the single module graph a root task (#74778)

parent 9fd30a53
...@@ -575,6 +575,13 @@ impl ReducedGraphs { ...@@ -575,6 +575,13 @@ impl ReducedGraphs {
} }
} }
// This is a performance optimization. This function is a root aggregation function that aggregates
// over the whole subgraph.
#[turbo_tasks::function]
async fn get_global_module_graph(project: ResolvedVc<Project>) -> Vc<SingleModuleGraph> {
SingleModuleGraph::new_with_entries(project.get_all_entries())
}
#[turbo_tasks::function(operation)] #[turbo_tasks::function(operation)]
async fn get_reduced_graphs_for_endpoint_inner_operation( async fn get_reduced_graphs_for_endpoint_inner_operation(
project: ResolvedVc<Project>, project: ResolvedVc<Project>,
...@@ -592,7 +599,9 @@ async fn get_reduced_graphs_for_endpoint_inner_operation( ...@@ -592,7 +599,9 @@ async fn get_reduced_graphs_for_endpoint_inner_operation(
false, false,
vec![ vec![
async move { async move {
SingleModuleGraph::new_with_entries(project.get_all_entries()) get_global_module_graph(*project)
.resolve_strongly_consistent()
.await?
.to_resolved() .to_resolved()
.await .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