[Dependency Scanning] Keep track of how many filesystem module lookups the dependency scanner performs on a given scan

This commit is contained in:
Artem Chikin
2024-12-05 14:26:56 -08:00
parent 25d32fc7a3
commit 48387eed55
5 changed files with 17 additions and 8 deletions

View File

@@ -95,6 +95,9 @@ public:
getNamedSwiftModuleDependencyInfo(StringRef moduleName,
ModuleDependenciesCache &cache);
/// How many filesystem lookups were performed by the scanner
unsigned getNumLookups() { return NumLookups; }
private:
/// Main routine that computes imported module dependency transitive
/// closure for the given module.
@@ -166,6 +169,8 @@ private:
llvm::StdThreadPool ScanningThreadPool;
/// Protect worker access.
std::mutex WorkersLock;
/// Count of filesystem queries performed
std::atomic<unsigned> NumLookups = 0;
};
} // namespace swift