Add profiling spans under cargo_to_crate_graph

This commit is contained in:
Laurențiu Nicola 2021-04-22 21:25:29 +03:00
parent e9fea823a0
commit 6b187af337
4 changed files with 7 additions and 3 deletions

1
Cargo.lock generated
View file

@ -1174,6 +1174,7 @@ dependencies = [
"log", "log",
"memmap", "memmap",
"object", "object",
"profile",
"serde", "serde",
"serde_json", "serde_json",
"snap", "snap",

View file

@ -15,10 +15,11 @@ serde_json = { version = "1.0", features = ["unbounded_depth"] }
log = "0.4.8" log = "0.4.8"
crossbeam-channel = "0.5.0" crossbeam-channel = "0.5.0"
jod-thread = "0.1.1" jod-thread = "0.1.1"
memmap = "0.7.0"
object = { version = "0.23.0", default-features = false, features = ["std", "read_core", "elf", "macho", "pe", "unaligned"] }
snap = "1.0"
tt = { path = "../tt", version = "0.0.0" } tt = { path = "../tt", version = "0.0.0" }
base_db = { path = "../base_db", version = "0.0.0" } base_db = { path = "../base_db", version = "0.0.0" }
stdx = { path = "../stdx", version = "0.0.0" } stdx = { path = "../stdx", version = "0.0.0" }
snap = "1" profile = { path = "../profile", version = "0.0.0" }
object = { version = "0.23.0", default-features = false, features = ["std", "read_core", "elf", "macho", "pe", "unaligned"] }
memmap = "0.7.0"

View file

@ -77,6 +77,7 @@ impl ProcMacroClient {
} }
pub fn by_dylib_path(&self, dylib_path: &Path) -> Vec<ProcMacro> { pub fn by_dylib_path(&self, dylib_path: &Path) -> Vec<ProcMacro> {
let _p = profile::span("ProcMacroClient::by_dylib_path");
match version::read_dylib_info(dylib_path) { match version::read_dylib_info(dylib_path) {
Ok(info) => { Ok(info) => {
if info.version.0 < 1 || info.version.1 < 47 { if info.version.0 < 1 || info.version.1 < 47 {

View file

@ -322,6 +322,7 @@ impl GlobalState {
let loader = &mut self.loader; let loader = &mut self.loader;
let mem_docs = &self.mem_docs; let mem_docs = &self.mem_docs;
let mut load = |path: &AbsPath| { let mut load = |path: &AbsPath| {
let _p = profile::span("GlobalState::load");
let vfs_path = vfs::VfsPath::from(path.to_path_buf()); let vfs_path = vfs::VfsPath::from(path.to_path_buf());
if !mem_docs.contains_key(&vfs_path) { if !mem_docs.contains_key(&vfs_path) {
let contents = loader.handle.load_sync(path); let contents = loader.handle.load_sync(path);