Commit cac6f25a authored by Will Binns-Smith's avatar Will Binns-Smith

[DO NOT MERGE] debugging module counts

parent a406b7a3
...@@ -27,8 +27,9 @@ use serde::{Deserialize, Serialize}; ...@@ -27,8 +27,9 @@ use serde::{Deserialize, Serialize};
use tracing::Instrument; use tracing::Instrument;
use turbo_rcstr::{RcStr, rcstr}; use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{ use turbo_tasks::{
Completion, Completions, FxIndexMap, IntoTraitRef, NonLocalValue, OperationValue, OperationVc, Completion, Completions, FxIndexMap, FxIndexSet, IntoTraitRef, NonLocalValue, OperationValue,
ReadRef, ResolvedVc, State, TaskInput, TransientInstance, TryFlatJoinIterExt, Vc, OperationVc, ReadRef, ResolvedVc, State, TaskInput, TransientInstance, TryFlatJoinIterExt,
TryJoinIterExt, Vc,
debug::ValueDebugFormat, debug::ValueDebugFormat,
fxindexmap, fxindexmap,
graph::{AdjacencyMap, GraphTraversal}, graph::{AdjacencyMap, GraphTraversal},
...@@ -983,6 +984,32 @@ impl Project { ...@@ -983,6 +984,32 @@ impl Project {
turbopack_node::evaluate::scale_zero(); turbopack_node::evaluate::scale_zero();
} }
let modules = module_graphs_vc
.await?
.full
.await?
.get_graphs()
.await?
.iter()
.flat_map(|g| g.iter_nodes())
.map(|n| n.module)
.collect::<Vec<_>>();
let source_files = modules
.iter()
.map(async |m| {
let ident = m.ident().await?;
Ok(ident.path.clone())
})
.try_join()
.await?
.into_iter()
.collect::<FxIndexSet<_>>();
println!(
"module count {:?}, source file count {:?}",
modules.len(),
source_files.len()
);
Ok(*module_graphs_vc) Ok(*module_graphs_vc)
} }
.instrument(tracing::info_span!("module graph for app")) .instrument(tracing::info_span!("module graph for app"))
......
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