-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc-confusable-identifiers
causing performance regression with clang-tidy-15
#57527
Comments
@llvm/issue-subscribers-clang-tidy |
The profiling information can be gathered by giving tidy |
Thanks.
I don't understand the help text though. It sounds like it is supposed to be a boolean instead and there's no indication how What kind of output should I provide? The regular one or the JSON one (however I do that)? Also is the JSON output in the Google profiler format (do I recall that correctly?) which can be visualized with Chrome? |
You cannot pass additional |
It actually creates a folder named after the specified |
I am generating files for both versions now. It's really hard to make something out by simply comparing them. It would be helpful if there were a key with the total time as well so it would be easier to identify files to drill into. |
I'd be willing to wager it's misc-confusable-identifiers check. That seems to have a high complexity |
Taking a quick peek it doesn't seem to be an outlier. Seems like several checks got a bit slower and there's several new ones on top of it - so it just adds up since it is well over 100 checks being executed. |
Here's the output. I generated it locally on ubuntu 20.04 with the following versions: I have no idea why those two files only have two checks applied. Also there's some files which are duplicated in the compilation database (they are Qt files which de-duplicated with qmake but not in the CMake build). Also some additional duplicates since I couldn't use FYI precompiled headers are being used. I am not sure if those make things faster or slower - something to still look into. |
For completeness: |
(Setting up CSA-Testbench, and CodeChecker underneath might be worth it just to have recurring analyses done quickly as it does precisely the "iterate all the files" for analysis, and CSA-Testbench iterates the results. Might be worth a long-term investment for the project, but for a single run of visualisation it should be alright without.)
As long as they are ON for both analyses, the results should still be consistent. Clang-Tidy enters the scene after the AST had been built. |
Thanks. That's very appreciated. |
I've done it. Raw data (needed a bit of manual Python tinkering): This is the
|
So the major regressions are (in descending order):
@njames93 was right though. Some observations:
|
It seems The problem with having an |
Or more obviously |
misc-confusable-identifiers
causing performance regression with clang-tidy-15
I changed the title so this focuses on the actual issue and filed separate issues for the other things I noted. How does If they are identical and since GCC enables |
One glaring issue that needs addressing is most of the time spent in |
As for other checks, most problems are in those "libraries", and should be tracked under separate issue on Clang 16/17 if occur. |
Using
clang-tidy-14
the step with the analysis in the GitHub Action of our project took about 8 minutes. Switching toclang-tidy-15
it now takes at least 13 minutes.run-clang-tidy-*
is being used with-j2
(actuallynproc
but that resolves to2
). I checked several builds to make sure it wasn't just an odd-one-out slow runner.We only recently did the switch and the first version we were using is
15.0.0~++20220825073216+12f27d8bef93-1~exp1~20220825073228.37
. The latest build which still experiences this used15.0.0~++20220902063112+11ba13a62506-1~exp1~20220902063219.49
. The last version used of the prior version was14.0.6~++20220816122211+f28c006a5895-1~exp1~20220816122246.108
.We are using the packages from https://apt.llvm.org on ubuntu 22.04. The project in question in https://github.com/danmar/cppcheck.
The
.clang-tidy
configuration is the same for both (obviouslyclang-tidy-15
comes with additional/improved checks):We are also leveraging it to report compiler warnings. I don't have the general list of parameters handy right now. There's a few slightly adjustments per file (via CMake) but it is about the same for most of the files.
I know there is some option to collect the timing information for each analysis but it is not documented and I no longer remembered where I read about it. If you point me to it I will happily provide that data.
The text was updated successfully, but these errors were encountered: