vsk added a comment.

Unfortunately it does look like the work done in gatherSkippedRegions is O(n^2) 
in the number of functions, at the moment. If the goal is to speed it up, it'd 
be good to grab some performance numbers for some representative compile unit 
(the sqlite3 amalgamation is my go-to for this sort of thing).



================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:353
+    SkippedRanges.erase(
+        std::remove_if(
+            SkippedRanges.begin(), SkippedRanges.end(),
----------------
In the worst case, the work done in gatherSkippedRegions may still be n + (n-1) 
+ ... ~ O(n^2) (I'm subtracting 1 each time the skipped regions for a function 
are erased).


================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:356
+            [&](SkippedRange I) {
+              SourceRange Range = I.Range;
+              auto LocStart = Range.getBegin();
----------------
It'd probably be good to split the lambda out into a separate/named helper.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87648

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to