diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-08-22 12:14:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 12:14:59 -0400 |
commit | 7a1a082876298a4c9e37237074ea62942180d083 (patch) | |
tree | 690b46889987a9f576a1b0601a322141b51b0660 /cli/main.rs | |
parent | c66386dbd20b735161017a239c6af013da1f1718 (diff) |
perf: cache swc dependency analysis and don't hold onto `ParsedSource`s in memory (#15502)
Diffstat (limited to 'cli/main.rs')
-rw-r--r-- | cli/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/main.rs b/cli/main.rs index 8e53d1f0c..d38403384 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -245,7 +245,8 @@ async fn compile_command( graph.valid().unwrap(); - let eszip = eszip::EszipV2::from_graph(graph, Default::default())?; + let store = ps.parsed_source_cache.as_store(); + let eszip = eszip::EszipV2::from_graph(graph, &*store, Default::default())?; info!( "{} {}", @@ -462,6 +463,7 @@ async fn create_graph_and_maybe_check( .as_ref() .map(|im| im.as_resolver()) }; + let analyzer = ps.parsed_source_cache.as_analyzer(); let graph = Arc::new( deno_graph::create_graph( vec![(root, deno_graph::ModuleKind::Esm)], @@ -470,7 +472,7 @@ async fn create_graph_and_maybe_check( &mut cache, maybe_resolver, maybe_locker, - None, + Some(&*analyzer), None, ) .await, @@ -556,7 +558,6 @@ async fn bundle_command( debug!(">>>>> bundle START"); let ps = ProcState::from_options(cli_options).await?; - let graph = create_graph_and_maybe_check(module_specifier, &ps, debug).await?; |