[PATCH] D97061: [llvm-cov] Compare path only to find the same file

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 10:43:06 PST 2021


vsk added a comment.

It seems unexpected that there's such a huge performance cost associated with sys::fs::equivalent.

Could you share a profile of part of your 56sec workload? It'd be helpful to know whether the bottleneck is in the filesystem, or in llvm code.

Do you know what the queries look like (would caching help)?

I'd hope that the performance problem can be solved without changing the tool's behavior. But if not, I don't think it's possible to change the default behavior, as this could silently regress existing workflows which depend on symlinks.



================
Comment at: llvm/tools/llvm-cov/CodeCoverage.cpp:264
+    for (const auto &Files : LoadedSourceFiles)
+      if (sys::fs::equivalent(SourceFile, Files.first))
+        return *Files.second;
----------------
Could you introduce a helper method that compares file paths for equality, so there's only one copy of the outer loop?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97061/new/

https://reviews.llvm.org/D97061



More information about the llvm-commits mailing list