mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 04:23:25 +00:00
Add profiling spans under cargo_to_crate_graph
This commit is contained in:
parent
e9fea823a0
commit
6b187af337
4 changed files with 7 additions and 3 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1174,6 +1174,7 @@ dependencies = [
|
|||
"log",
|
||||
"memmap",
|
||||
"object",
|
||||
"profile",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"snap",
|
||||
|
|
|
@ -15,10 +15,11 @@ serde_json = { version = "1.0", features = ["unbounded_depth"] }
|
|||
log = "0.4.8"
|
||||
crossbeam-channel = "0.5.0"
|
||||
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" }
|
||||
base_db = { path = "../base_db", version = "0.0.0" }
|
||||
stdx = { path = "../stdx", version = "0.0.0" }
|
||||
snap = "1"
|
||||
object = { version = "0.23.0", default-features = false, features = ["std", "read_core", "elf", "macho", "pe", "unaligned"] }
|
||||
memmap = "0.7.0"
|
||||
profile = { path = "../profile", version = "0.0.0" }
|
||||
|
|
|
@ -77,6 +77,7 @@ impl ProcMacroClient {
|
|||
}
|
||||
|
||||
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) {
|
||||
Ok(info) => {
|
||||
if info.version.0 < 1 || info.version.1 < 47 {
|
||||
|
|
|
@ -322,6 +322,7 @@ impl GlobalState {
|
|||
let loader = &mut self.loader;
|
||||
let mem_docs = &self.mem_docs;
|
||||
let mut load = |path: &AbsPath| {
|
||||
let _p = profile::span("GlobalState::load");
|
||||
let vfs_path = vfs::VfsPath::from(path.to_path_buf());
|
||||
if !mem_docs.contains_key(&vfs_path) {
|
||||
let contents = loader.handle.load_sync(path);
|
||||
|
|
Loading…
Reference in a new issue