This patch adds new -print-timing option to clang-scan-deps. It measures the wall and process time taken to scan dependencies for the compilation database. This provides more representative data compared to measuring the timing for the whole tool invocation, since that includes parsing and generating JSON files, which can be significant for larger inputs.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Could you also add a -terse option, to avoid printing the full dependency info, if you mainly want to get the timing? Something like this:
T.stopTimer(); if (PrintTiming) llvm::errs() << llvm::format( "clang-scan-deps timing: %0.2fs wall, %0.2fs process\n", T.getTotalTime().getWallTime(), T.getTotalTime().getProcessTime()); if (Terse) { if (Format == ScanningOutputFormat::Full) { llvm::errs() << "num modules: " << FD->getNumModules() << '\n'; } return HadErrors; }
Where getNumModules() is
size_t getNumModules() const { return Modules.size(); }
So you still get some very high-level info but not the whole dump of info.
Comment Actions
Could you also add a -terse option, to avoid printing the full dependency info
Note I added something like this in https://reviews.llvm.org/D148369, so ignore it for this patch.