Skip to content

Commit e13065b

Browse files
committed
Add profile call
1 parent fde4a86 commit e13065b

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/project_model/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ toolchain = { path = "../toolchain", version = "0.0.0" }
2525
proc_macro_api = { path = "../proc_macro_api", version = "0.0.0" }
2626
paths = { path = "../paths", version = "0.0.0" }
2727
stdx = { path = "../stdx", version = "0.0.0" }
28+
profile = { path = "../profile", version = "0.0.0" }

crates/project_model/src/workspace.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ impl ProjectWorkspace {
207207
proc_macro_client: Option<&ProcMacroClient>,
208208
load: &mut dyn FnMut(&AbsPath) -> Option<FileId>,
209209
) -> CrateGraph {
210+
let _p = profile::span("ProjectWorkspace::to_crate_graph");
210211
let proc_macro_loader = |path: &Path| match proc_macro_client {
211212
Some(client) => client.by_dylib_path(path),
212213
None => Vec::new(),
@@ -299,6 +300,7 @@ fn cargo_to_crate_graph(
299300
sysroot: &Sysroot,
300301
rustc: &Option<CargoWorkspace>,
301302
) -> CrateGraph {
303+
let _p = profile::span("cargo_to_crate_graph");
302304
let mut crate_graph = CrateGraph::default();
303305
let (public_deps, libproc_macro) =
304306
sysroot_to_crate_graph(&mut crate_graph, sysroot, target, load);
@@ -493,6 +495,7 @@ fn sysroot_to_crate_graph(
493495
target: Option<&str>,
494496
load: &mut dyn FnMut(&AbsPath) -> Option<FileId>,
495497
) -> (Vec<(CrateName, CrateId)>, Option<CrateId>) {
498+
let _p = profile::span("sysroot_to_crate_graph");
496499
let mut cfg_options = CfgOptions::default();
497500
cfg_options.extend(get_rustc_cfg_options(target));
498501
let sysroot_crates: FxHashMap<SysrootCrate, CrateId> = sysroot

crates/rust-analyzer/src/reload.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ impl GlobalState {
274274
}
275275

276276
fn reload_flycheck(&mut self) {
277+
let _p = profile::span("GlobalState::reload_flycheck");
277278
let config = match self.config.flycheck() {
278279
Some(it) => it,
279280
None => {

0 commit comments

Comments
 (0)