[PATCH] D13516: Fix overlapping replacements in clang-tidy.
Angel Garcia via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 14 08:17:14 PDT 2015
angelgarcia added a comment.
I've done a couple of runs for each version, and these are the results (I
have clang-tidy compiled with the option "RelWithDebInfo"):
$ time clang-tidy -checks=* test.cpp -- -std=c++11
Without looking for overlaps.
Suppressed 23463 warnings (23463 in non-user code).
Use -header-filter=.* to display errors from all non-system headers.
real 2m14.572s
user 2m13.136s
sys 0m0.483s
real 2m15.103s
user 2m13.361s
sys 0m0.687s
Bounding boxes
Suppressed 23463 warnings (23463 in non-user code).
Use -header-filter=.* to display errors from all non-system headers.
real 2m14.208s
user 2m13.051s
sys 0m0.643s
real 2m16.368s
user 2m14.286s
sys 0m0.986s
Quadratic
Suppressed 23463 warnings (23463 in non-user code).
Use -header-filter=.* to display errors from all non-system headers.
real 2m15.130s
user 2m13.627s
sys 0m0.499s
real 2m15.322s
user 2m13.660s
sys 0m0.683s
The time is about the same for all three versions. Note that the first
version doesn't do any sweep at all, and the last version invariably does
(23463 choose 2) = 275244453 sweeps. The amount of time required to do this
seems to be too low compared to the time that clang-tidy takes to output
these diagnostics.
Also, the fact that all three versions take about the same time is a bit
suspicious, but I double-checked that I was doing it right (I did a small
file with would cause overlapping and I checked if the message "note: this
fix will not be applied because it overlaps with another fix" was there
before each run).
I intended to implement Daniel's idea to check out which one was more
efficient, but with these results in sight I don't think it is worth it.
http://reviews.llvm.org/D13516
More information about the cfe-commits
mailing list