Skip to content

Commit

Permalink
add spans for metadata construction
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Nov 2, 2023
1 parent 351819c commit 6b7326a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/turborepo-scm/src/package_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ impl<'a> CachedPackageFileHasher<'a> {
})
};

let span = tracing::debug_span!("constructing trie");
let enter = span.enter();

let (path_hashes, to_hash) = {
let mut path_hashes = j1.join().unwrap();
let (to_hash, to_remove) = j2.join().unwrap();
Expand All @@ -64,6 +67,11 @@ impl<'a> CachedPackageFileHasher<'a> {
file_trie.insert_str(path.as_str(), ());
}

drop(enter);

let span = tracing::debug_span!("constructing map");
let enter = span.enter();

// a subpackage will always have a longer length than its parent,
// so we sort by length to ensure that we always and drain subpackages
// before their parents
Expand Down Expand Up @@ -98,6 +106,8 @@ impl<'a> CachedPackageFileHasher<'a> {
));
}

drop(enter);

Self::Git(GitCachedPackageFileHasher { git, map })
}
SCM::Manual => Self::Manual,
Expand Down

0 comments on commit 6b7326a

Please sign in to comment.